def main():

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



    for x in range(10000):

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

            print(x)

            return



    print((-1))





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

def main():

    from math import ceil



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



    la, ra = ceil(A * 12.5), ceil((A + 1) * 12.5)

    lb, rb = B * 10, (B + 1) * 10



    L, R = max(la, lb), min(ra, rb)  # [L,R)



    if L >= R:

        print((-1))

        return



    print(L)





if __name__ == '__main__':

    main()

def main():
    A, B = list(map(int, input().split()))
    for x in range(10000):
        if int(x * 0.08) == A and int(x * 0.1) == B:
            print(x)
            return
    print((-1))


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

def main():
    from math import ceil

    A, B = list(map(int, input().split()))
    la, ra = ceil(A * 12.5), ceil((A + 1) * 12.5)
    lb, rb = B * 10, (B + 1) * 10
    L, R = max(la, lb), min(ra, rb)  # [L,R)
    if L >= R:
        print((-1))
        return
    print(L)


if __name__ == "__main__":
    main()

+    from math import ceil + -    for x in range(10000): -        if int(x * 0.08) == A and int(x * 0.1) == B: -            print(x) -            return -    print((-1)) +    la, ra = ceil(A * 12.5), ceil((A + 1) * 12.5) +    lb, rb = B * 10, (B + 1) * 10 +    L, R = max(la, lb), min(ra, rb)  # [L,R) +    if L >= R: +        print((-1)) +        return +    print(L) -# import sys -# -# sys.setrecursionlimit(10 ** 7) -# -# input = sys.stdin.readline -# rstrip() -# int(input()) -# map(int, input().split())