a,b,c,d=[int(i) for i in input().split()] e=b-a+1 f=d-c+1 g=e*f h=b-c-1 if c>b: print(g-h) else: print(g)