#!/usr/bin/env python3

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

for i in range(10 ** 5):

    if i * 8 // 100 == a and i // 10 == b:

        print(i)

        exit()

print((-1))

#!/usr/bin/env python3

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

mn = max(100 * a, 80 * b)

mx = min(100 * a + 99, 80 * b + 72)

print(((mn + 7) // 8 if mn <= mx else -1))

#!/usr/bin/env python3
a, b = list(map(int, input().split()))
for i in range(10**5):
    if i * 8 // 100 == a and i // 10 == b:
        print(i)
        exit()
print((-1))

#!/usr/bin/env python3
a, b = list(map(int, input().split()))
mn = max(100 * a, 80 * b)
mx = min(100 * a + 99, 80 * b + 72)
print(((mn + 7) // 8 if mn <= mx else -1))

-for i in range(10**5): -    if i * 8 // 100 == a and i // 10 == b: -        print(i) -        exit() -print((-1)) +mn = max(100 * a, 80 * b) +mx = min(100 * a + 99, 80 * b + 72) +print(((mn + 7) // 8 if mn <= mx else -1))