n = list(map(int, input().split())) all = (n[1] - n[0] + 1)*(n[3] - n[2] + 1) if n[0] < n[2] and n[1] > n[3]: excp= n[3] - n[2] + 1 elif n[0] > n[2] and n[1] < n[3]: excp= n[1] - n[0] + 1 elif n[0] <= n[2] and n[1] > n[2]: excp = n[1] - n[2] + 1 elif n[0] >= n[2] and n[3] > n[0]: excp = n[3] - n[0] + 1 else: excp = 0 print(all - excp)