a,b,c,d=map(int,input().split()) ans=(b-a+1)*(d-c+1) for i in range(101): if a<=i and i<=b and c<=i and i<=d: ans-=1 print(ans)