s=open(0).read().split() t=[int(s[i+3])-int(s[i%3])for i in range(9)] print(sum(t[i]*t[3+(i+1)%3]*t[6+(i+2)%3]for i in range(3)))