a,b,c,d=map(int,input().split()) g=0 for i in range(a,b+1): for j in range(c,d+1): g+=i!=j print(g)