a,b,c,d=map(int,input().split()) print(~(b-a)*~(d-c)-len(set(range(a,-~b))&set(range(c,-~d))))