def main():
    a, b = int(input()), int(input())
    c = max(a, b) - min(a, b)
    steps = c // 2
    additional = c % 2
    s = (steps + 1) * steps
    if additional:
        s += additional * (steps + 1)
    print(s)


if __name__ == '__main__':
    main()
