program answer
  implicit none

  integer :: A, B
  integer :: ans

  read(*,*) A, B

  if (12.5*A<10*B) then
     if(10*B<12.5*A+12.5) then
       ans =  10*B
     else
        ans =  -1
     end if
  else
     if (12.5*A<10*B+10) then
        if (mod (A,2)==1) then
           ans = int(12.5*A)+1
        else
           ans = 12.5*A
        end if
     else
        ans =  -1
     end if
  end if
  

  write(*,*) ans
  stop
 end program answer
