A, B, C, D = [int(i) for i in input().strip().split(' ')] print('{}'.format((B - A + 1) * (D - C + 1) - max(0, B - C + 1)))