program main
      implicit none
      integer(4) :: a, b, i, j, k

      read(*,*) a, b

      do k = 1, 1009
        i = k * 0.08
        j = k * 0.10
        if (( i == a ) .and. ( j == b )) then
          print *, k
          exit
        end if
      end do
      if ( k == 1010 ) then
        print *, "-1"
      end if

end program main

