GI = lambda: int(input()); GIS = lambda: map(int, input().split()); LGIS = lambda: list(GIS())

def main():
  a = GI(); b = GI()
  d = abs(a - b)
  div, mod = divmod(d, 2)

  l = [div + mod, div]
  print(int(sum(n * (n + 1) / 2 for n in l)))

main()
