from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log, pi, e, asin,acos, cos, sin
from itertools import *
from fractions import Fraction
import string
import copy
import random
import bisect
from decimal import *
def id_generator(size=20, chars=string.digits):
	return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
	return map(int,str(raw_input()).split())
 
a=input()
b=input()
z=abs(a-b)
t=z/2
if z%2==0:
	print (t*(t+1))
else:
	print (t*(t+1))+(z+1)/2
