i,j,a[8];main(s){for(i=36;scanf("%d",a+j++),i--;)s-=a[i/2]*a[(i+3)/2%3+3+((i/6+1)&2)*3]*a[8-i/12*6-i%3]*(1-i%2*2);printf("%d",s/6);}