#      *
#     * *
#    *   *
#   *  *  *  Author:Aditya Joshi
#  *       *
# *         *
a = int(input())
b = int(input())
r = abs(a - b) // 2
r1 = abs(a - b) - r
s = (r * (r + 1)) // 2
s += (r1 * (r1 + 1)) // 2
print(s)
