a,b,c,d,e,f,g,h,i=[int(b)-a for a,b in zip([*map(int,input().split())]*3,open(0).read().split())] print((a*e*i+b*f*g+c*d*h-a*h*f-b*i*d-c*g*e)//6)