import sys
from math import sqrt, floor, factorial
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

def solve():
	a = int(inp()); b = int(inp())
	m = abs(a-b); n = m//2
	print(n*(n+1) + [0, n+1][m%2])




if __name__ == "__main__":
	solve()
# addcbcdda
# addcbcdda