a, b, c, d = map(int, input().split()) num = 0 for i in range(1, 101): if a <= i <= b and c <= i <= d: num += 1 print((b-a+1)*(d-c+1)-num)