import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val A = Array.fill(N)(sc.nextInt)

  var money = 1000
  var stock = 0
  val a = A.foldLeft(Seq.empty[Int])((z, x) => {
    if (z.nonEmpty && x == z.head) z
    else if (z.size >= 2 && z.head > z(1) && x > z.head) x +: z.tail
    else if (z.size >= 2 && z.head < z(1) && x < z.head) x +: z.tail
    else x +: z
  }).reverse

  val b = a.sliding(2).map(x => x.head < x.last).toSeq
  for (i <- b.indices) {
    if (b(i)) {
      stock += money / a(i)
      money -= stock * a(i)
    } else {
      money += stock * a(i)
      stock = 0
    }
  }

  money += stock * a.last
  stock = 0

  println(money)
}
