object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextInt
  val As = List.fill(N)(in.nextInt)

  println(
    As.zip(As.tail).foldLeft(1000L){case (money, (now, next)) =>
      if (now <= next) money / now * next + money % now
      else money
    }
  )
}
