def main():
    a = int(input())
    b = int(input())

    diff = abs(a-b)
    amount = diff // 2
    parity = diff % 2

    print((1 + amount) * amount + parity * (amount + 1))


if __name__ == "__main__":
    main()