import math

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

 

def problem_koganemaru(A,B):  

  for price in range(10000):

    if math.floor(price*0.08) == A and math.floor(price*0.1) == B:

      return price

  return -1

 

print((problem_koganemaru(A,B)))
import math

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

def problem_gksn(A, B):

  x_min = math.ceil(A / (0.08))

  x_max = math.floor((A+1)/0.08)

  y_min = math.ceil(B / (0.10))

  y_max = math.floor((B+1) / (0.10))

  # print(x_min,x_max,y_min,y_max)

  if max(x_min, y_min) < min(x_max, y_max):

    return max(x_min, y_min)

  else:

    return -1

print((problem_gksn(A,B)))

# {[ } ]
import math

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


def problem_koganemaru(A, B):
    for price in range(10000):
        if math.floor(price * 0.08) == A and math.floor(price * 0.1) == B:
            return price
    return -1


print((problem_koganemaru(A, B)))

import math

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


def problem_gksn(A, B):
    x_min = math.ceil(A / (0.08))
    x_max = math.floor((A + 1) / 0.08)
    y_min = math.ceil(B / (0.10))
    y_max = math.floor((B + 1) / (0.10))
    # print(x_min,x_max,y_min,y_max)
    if max(x_min, y_min) < min(x_max, y_max):
        return max(x_min, y_min)
    else:
        return -1


print((problem_gksn(A, B)))
# {[ } ]

-def problem_koganemaru(A, B): -    for price in range(10000): -        if math.floor(price * 0.08) == A and math.floor(price * 0.1) == B: -            return price -    return -1 +def problem_gksn(A, B): +    x_min = math.ceil(A / (0.08)) +    x_max = math.floor((A + 1) / 0.08) +    y_min = math.ceil(B / (0.10)) +    y_max = math.floor((B + 1) / (0.10)) +    # print(x_min,x_max,y_min,y_max) +    if max(x_min, y_min) < min(x_max, y_max): +        return max(x_min, y_min) +    else: +        return -1 -print((problem_koganemaru(A, B))) +print((problem_gksn(A, B))) +# {[ } ]