#!/usr/bin/env python3

import sys

a = int(sys.stdin.readline().strip())
b = int(sys.stdin.readline().strip())

def tri(d):
	return (d * (d + 1)) // 2

d = abs(a - b)
if d % 2 == 0:
	tide = 2 * tri(d // 2)
else:
	tide = tri((d - 1) // 2) + tri((d + 1) // 2)
	
print (tide)
