if __name__ == '__main__':
    a = int(raw_input())
    b = int(raw_input())
    chazhi = abs(a-b)
    if chazhi % 2 == 0:
        step = chazhi / 2
        ans = sum(range(1, step + 1)) * 2
    else:
        step = chazhi / 2
        ans = sum(range(1, step + 1)) * 2 + step + 1
    print ans
	   	 	        	  	 	  							