a[];s;main(y,z){z=12;for(;z--;)scanf("%d",a+z);for(z=9;z--;)a[z]-=a[9+z%3];for(z=3;z--;)s+=a[z]*(a[3+-~z%3]*a[6+(z+2)%3]-a[3+(z+2)%3]*a[6+-~z%3]);printf("%d",s/6);}