A,B,C,D = map(int,input().split()) ans = (B - A + 1) * (D - C + 1) for i in range(1, 101): if A <= i <= B and C <= i <= D: ans -= 1 print(ans)