a,b,c,d = map(int,input().split()) s = (b-a)*(d-c) if min(b,d)-max(a,c) >= 0: s -= min(b,d)-max(a,c)+1 print(s)