l =[int(i)for i in input().split()] n = l[1]-l[0]+1 m = l[3]-l[2]+1 ans = m*n A=set([i for i in range(l[0],l[1]+1)]) B=set([i for i in range(l[2],l[3]+1)]) C =A & B ans -= len(list(C)) print(ans)