import sys

# import math

# import decimal

# import queue

# import bisect

# import heapq

# import time

# import itertools

# from fractions import Fraction



mod = int(1e9+7)

INF = 1<<29



def main():

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

    ans = []

    x = int(min(a//0.08,b//0.1))

    y = int(max((a+1)//0.08,(b+1)//0.1))

    for i in range(x,y+1):

        if int(i*0.08)==a and int(i*0.1)==b:

            ans.append(i)

    if len(ans):

        print((min(ans)))

    else:

        print((-1))

    return



if __name__=='__main__':

    main()

import sys



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

low = int(min(a//0.08,b//0.1))

high = int(max((a+1)//0.08,(b+1)//0.1))

for i in range(low,high+1):

  if int(i*0.08)==a and int(i*0.1)==b:

    print(i)

    sys.exit()

print((-1))
import sys

# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction
mod = int(1e9 + 7)
INF = 1 << 29


def main():
    a, b = list(map(int, input().split()))
    ans = []
    x = int(min(a // 0.08, b // 0.1))
    y = int(max((a + 1) // 0.08, (b + 1) // 0.1))
    for i in range(x, y + 1):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            ans.append(i)
    if len(ans):
        print((min(ans)))
    else:
        print((-1))
    return


if __name__ == "__main__":
    main()

import sys

a, b = list(map(int, input().split()))
low = int(min(a // 0.08, b // 0.1))
high = int(max((a + 1) // 0.08, (b + 1) // 0.1))
for i in range(low, high + 1):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        sys.exit()
print((-1))

-# import math -# import decimal -# import queue -# import bisect -# import heapq -# import time -# import itertools -# from fractions import Fraction -mod = int(1e9 + 7) -INF = 1 << 29 - - -def main(): -    a, b = list(map(int, input().split())) -    ans = [] -    x = int(min(a // 0.08, b // 0.1)) -    y = int(max((a + 1) // 0.08, (b + 1) // 0.1)) -    for i in range(x, y + 1): -        if int(i * 0.08) == a and int(i * 0.1) == b: -            ans.append(i) -    if len(ans): -        print((min(ans))) -    else: -        print((-1)) -    return - - -if __name__ == "__main__": -    main() +a, b = list(map(int, input().split())) +low = int(min(a // 0.08, b // 0.1)) +high = int(max((a + 1) // 0.08, (b + 1) // 0.1)) +for i in range(low, high + 1): +    if int(i * 0.08) == a and int(i * 0.1) == b: +        print(i) +        sys.exit() +print((-1))