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