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



S=max(12.5*A,10*B)



if S%1!=0:

    S=S//1+1



if S<12.5*A+12.5 and S<10*B+10:

    print((int(S)))

else:

    print("-1")
A,B=list(map(int,input().split()))



S=max(12.5*A,10*B)



if S%1!=0:

    S=int(S)+1



if S<12.5*A+12.5 and S<10*B+10:

    print((int(S)))

else:

    print("-1")

A, B = list(map(int, input().split()))
S = max(12.5 * A, 10 * B)
if S % 1 != 0:
    S = S // 1 + 1
if S < 12.5 * A + 12.5 and S < 10 * B + 10:
    print((int(S)))
else:
    print("-1")

A, B = list(map(int, input().split()))
S = max(12.5 * A, 10 * B)
if S % 1 != 0:
    S = int(S) + 1
if S < 12.5 * A + 12.5 and S < 10 * B + 10:
    print((int(S)))
else:
    print("-1")

-    S = S // 1 + 1 +    S = int(S) + 1