def main():

    a, b = list(map(int, input().split()))

    eight = [i for i in range(0, 2000) if a == int(i * 0.08)]

    ten = [i for i in range(0, 2000) if b == int(i * 0.1)]

    for i in eight:

        for j in ten:

            if i == j:

                print(i)

                return

    print((-1))





if __name__ == '__main__':

    main()

def main():

    a, b = list(map(int, input().split()))

    al = int(a / 0.08 + 0.5)

    bl = int(b / 0.1)

    au = al + 12 - a % 2

    bu = bl + 9

    if bu < al or au < bl:

        print((-1))

    else:

        print((max(al, bl)))





if __name__ == '__main__':

    main()

def main():
    a, b = list(map(int, input().split()))
    eight = [i for i in range(0, 2000) if a == int(i * 0.08)]
    ten = [i for i in range(0, 2000) if b == int(i * 0.1)]
    for i in eight:
        for j in ten:
            if i == j:
                print(i)
                return
    print((-1))


if __name__ == "__main__":
    main()

def main():
    a, b = list(map(int, input().split()))
    al = int(a / 0.08 + 0.5)
    bl = int(b / 0.1)
    au = al + 12 - a % 2
    bu = bl + 9
    if bu < al or au < bl:
        print((-1))
    else:
        print((max(al, bl)))


if __name__ == "__main__":
    main()

-    eight = [i for i in range(0, 2000) if a == int(i * 0.08)] -    ten = [i for i in range(0, 2000) if b == int(i * 0.1)] -    for i in eight: -        for j in ten: -            if i == j: -                print(i) -                return -    print((-1)) +    al = int(a / 0.08 + 0.5) +    bl = int(b / 0.1) +    au = al + 12 - a % 2 +    bu = bl + 9 +    if bu < al or au < bl: +        print((-1)) +    else: +        print((max(al, bl)))