object main extends App{
  val N = scala.io.StdIn.readLine().toInt
  val xss = for(l <- scala.io.Source.stdin.getLines) yield (l.toInt)
  xss.min match {
    case _ >= N => println(N)
    case _ < N if N % _ == 0 => println(N / _)
    case _ => println(N)
  }
}