num = list(map(int, input().split())) ans=0 for i in range(num[0],num[1]+1): for j in range(num[2],num[3]+1): if i != j: ans+=1 print(ans)