import sys input = sys.stdin.readline A,B,C,D,E=map(int,input().split()) X=(A+B)*(C+D) X1=[0]*X X2=[0]*X time=0 for i in range(X): if time