# ABC158 C

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

# x=a*(100/8)

# y=b*(100/10)



# print(x,y)

# print(int(x),int(y))



# sx=x*((108-8)/100)

# sy=y*((110-10)/100)



# print(int(sx),int(sy))



for i in range(200000):

    x,y=0.0,0.0

    x=i*0.08

    y=i*0.10

    if a==int(x) and b==int(y):

        print(i)

        exit()

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

for i in range(1,10001):

  tax_a=int(i*0.08)

  tax_b=int(i*0.10)

  if tax_a==a and tax_b==b:

    print(i)

    exit(0)

print((-1))
# ABC158 C
a, b = list(map(int, input().split()))
# x=a*(100/8)
# y=b*(100/10)
# print(x,y)
# print(int(x),int(y))
# sx=x*((108-8)/100)
# sy=y*((110-10)/100)
# print(int(sx),int(sy))
for i in range(200000):
    x, y = 0.0, 0.0
    x = i * 0.08
    y = i * 0.10
    if a == int(x) and b == int(y):
        print(i)
        exit()
print((-1))

a, b = list(map(int, input().split()))
for i in range(1, 10001):
    tax_a = int(i * 0.08)
    tax_b = int(i * 0.10)
    if tax_a == a and tax_b == b:
        print(i)
        exit(0)
print((-1))

-# ABC158 C -# x=a*(100/8) -# y=b*(100/10) -# print(x,y) -# print(int(x),int(y)) -# sx=x*((108-8)/100) -# sy=y*((110-10)/100) -# print(int(sx),int(sy)) -for i in range(200000): -    x, y = 0.0, 0.0 -    x = i * 0.08 -    y = i * 0.10 -    if a == int(x) and b == int(y): +for i in range(1, 10001): +    tax_a = int(i * 0.08) +    tax_b = int(i * 0.10) +    if tax_a == a and tax_b == b: -        exit() +        exit(0)