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

count=0

for i in range(1,20000):

    ans1=int(0.08*i)

    ans2=int(0.1*i)

    if ans1==A and ans2==B:

        print(i)

        count=1

        break

if count==0:

    print((-1))
A,B=[int(x) for x in input().rstrip().split()]



flag=0

for i in range(1,1001):

  if int(i*0.08)==A and int(i*0.1)==B:

    print(i)

    flag=1

    break

if flag==0:

  print((-1))

A, B = [int(x) for x in input().rstrip().split()]
count = 0
for i in range(1, 20000):
    ans1 = int(0.08 * i)
    ans2 = int(0.1 * i)
    if ans1 == A and ans2 == B:
        print(i)
        count = 1
        break
if count == 0:
    print((-1))

A, B = [int(x) for x in input().rstrip().split()]
flag = 0
for i in range(1, 1001):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        flag = 1
        break
if flag == 0:
    print((-1))

-count = 0 -for i in range(1, 20000): -    ans1 = int(0.08 * i) -    ans2 = int(0.1 * i) -    if ans1 == A and ans2 == B: +flag = 0 +for i in range(1, 1001): +    if int(i * 0.08) == A and int(i * 0.1) == B: -        count = 1 +        flag = 1 -if count == 0: +if flag == 0: