from __future__ import print_function, division
from sys import stdin, stdout
from fractions import gcd
from math import *
from collections import *
from operator import mul
from functools import reduce
from copy import copy

rstr = lambda: stdin.readline().strip()
rstrs = lambda: [str(x) for x in stdin.readline().split()]
rint = lambda: int(stdin.readline())
rints = lambda: [int(x) for x in stdin.readline().split()]
rstr_2d = lambda n: [rstr() for _ in range(n)]
rints_2d = lambda n: [rints() for _ in range(n)]
pr = lambda args, sep: stdout.write(sep.join(map(str, args)) + '\n')
sum_n = lambda n: (n * (n + 1)) // 2
out = []

a = sorted([rint() for _ in range(2)])
print(sum_n((a[1] - a[0]) >> 1) * 2 + int(ceil((a[1] - a[0]) / 2)) * ((a[1] - a[0]) & 1))
