a,b,c,d = map(int,input().split()) e = b-a+1 f = d-c+1 g = max(a,c) h = min(b,d) if g > h: print(e*f) else: print(e*f-(h-g+1))