r1, r2, b1, b2 = map(int, input().split(' ')) ans = (r2 - r1 + 1) * (b2 - b1 + 1) for i in range(r1, r2 + 1): for j in range(b1, b2 + 1): if i == j: ans -= 1 print(ans)