from math import floor

A, B = list(map(int,input().split()))

for k in range(1,20000):

    if floor(k*0.08) == A and floor(k*0.1) == B:

        print(k)

        exit(0)

print((-1))

A, B = list(map(int,input().split()))

for k in range(1,20000):

    if int(k*1.08) == A+k and int(k*1.10) == B+k:

        print(k)

        exit(0)

print((-1))

from math import floor

A, B = list(map(int, input().split()))
for k in range(1, 20000):
    if floor(k * 0.08) == A and floor(k * 0.1) == B:
        print(k)
        exit(0)
print((-1))

A, B = list(map(int, input().split()))
for k in range(1, 20000):
    if int(k * 1.08) == A + k and int(k * 1.10) == B + k:
        print(k)
        exit(0)
print((-1))

-from math import floor - -    if floor(k * 0.08) == A and floor(k * 0.1) == B: +    if int(k * 1.08) == A + k and int(k * 1.10) == B + k: