A, B, C, D = map(int, input().split(' ')) yyy = ((B - A + 1) * (D - C + 1)) if B >= C: print(yyy - (B - C + 1)) else: print(yyy)