def c_tax_increase():

    A, B = [int(i) for i in input().split()]

    for k in range(1, 10**6):

        t1 = 8 * k // 100

        t2 = k // 10

        if t1 > 0 and t2 > 0 and t1 == A and t2 == B:

            return k

    return -1



print((c_tax_increase()))
def c_tax_increase():

    from math import floor, ceil

    A, B = [int(i) for i in input().split()]

    lower = ceil(max(25 * A / 2, 10 * B))

    upper = floor(min(25 * (A + 1) / 2, 10 * (B + 1)))

    return lower if lower < upper else -1



print((c_tax_increase()))
def c_tax_increase():
    A, B = [int(i) for i in input().split()]
    for k in range(1, 10**6):
        t1 = 8 * k // 100
        t2 = k // 10
        if t1 > 0 and t2 > 0 and t1 == A and t2 == B:
            return k
    return -1


print((c_tax_increase()))

def c_tax_increase():
    from math import floor, ceil

    A, B = [int(i) for i in input().split()]
    lower = ceil(max(25 * A / 2, 10 * B))
    upper = floor(min(25 * (A + 1) / 2, 10 * (B + 1)))
    return lower if lower < upper else -1


print((c_tax_increase()))

+    from math import floor, ceil + -    for k in range(1, 10**6): -        t1 = 8 * k // 100 -        t2 = k // 10 -        if t1 > 0 and t2 > 0 and t1 == A and t2 == B: -            return k -    return -1 +    lower = ceil(max(25 * A / 2, 10 * B)) +    upper = floor(min(25 * (A + 1) / 2, 10 * (B + 1))) +    return lower if lower < upper else -1