a=input();

b=input();

s = 0;

if(b-a>0):
    s = b-a;
else:
    s = a-b;

minTired=0;

if(s==1):
    print 1;

else:
 dis=s/2;

 if(s%2==0):
   minTired = ((dis)*(dis+1))/2+((dis)*(dis+1))/2;
 else:
   minTired = ((dis)*(dis+1))/2+((dis+1)*(dis+2))/2;

 print minTired;
