import sys
from collections import *
from math import *
import re
def inp_arr():return list(map(int,input().split()))
def inp():return map(int,input().split())
def lcm(a,b):return (a*b)/gcd(a,b)
def even(n):return[False,True][0 if n%2 else 1]
max_int = sys.maxsize
mod = 10**9+7

def solver(n):return int(n*(n+1)/2)
a,b=int(input()),int(input())
n=abs(a-b)
print(solver(ceil(n/2))+solver(floor(n/2)))