object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN) = readLine.split(" ").map(_.toInt)
    val datA = readLine.split(" ").map(_.toInt)

    var money = 1000L;
    var stock = 0;
    var price = 0;

    (0 until datN - 1) foreach {i =>
      if (stock == 0) {
        if (datA(i + 1) > datA(i)) {
          stock = (money / datA(i)).toInt
          money -= datA(i) * stock
          price = datA(i)
        }
      } else {
        if (datA(i + 1) < datA(i)) {
          money += datA(i) * stock
          stock = 0
          price = 0
        }
      }
    }

    if (stock != 0) {
      if (datA.last > price) money += stock * datA.last
      else money += stock * price
    }

    println(money)
  }
}
