public class Qiao {
private static boolean used[]=new boolean[10];private static int a[]=new int[10];private static long m1,m2,m3;
public static int sum=0;
public static void ff(int level){
for(int i=1;i<10;i++){ if(!used[i]){ a[level]=i; used[i]=true; if(level!=9){ ff(level+1); } else{ m1=a[2]*10+a[3]; m2=a[5]*10+a[6]; m3=a[8]*10+a[9]; long n1=a[1]*m2*m3; long n2=a[4]*m1*m3; long n3=a[7]*m1*m2; if(m1
}
public static void main(String args[]){ ff(1); System.out.println(sum); }
}