z=12;a[12];s,q;main(p){for(;scanf("%d",a+--z);a[z%9]-=a[9+z%3],s+=a[z%3]*=a[p=3+-~z%3]*a[q=z?5+z:8]-a[q-3]*a[p+3]);printf("%d",s/6);}