Xa = int(input("Masukkan kordinat a : "))
Xb = int(input("Masukkan kordinat b: "))

if Xa < 1 or Xa > 1000 or Xb < 1 or Xb > 1000 or Xa == Xb :
    exit()

if Xa > Xb :
    range = Xa - Xb
else :
    range = Xb - Xa

if range % 2 == 0 :
    tiredness = ((range/2)*(range/2))+(range/2)
    tiredness = (round(tiredness))
    print (f'{tiredness}\n')
else :
    tiredness = (((range-1)/2)+1)*(((range-1)/2)+1)
    tiredness = (round(tiredness))
    print (f'{tiredness}\n')
