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