a = int(input()) e = int(input()) - a b = int(input()) c = int(input()) d = c - int(input()) print(e * b * d)