object Main {
  def main(args: Array[String]): Unit = {
    val days  = scala.io.StdIn.readInt
    val rates = scala.io.StdIn.readLine.split(" ").map{_.toInt}

    var have_money = 1000
    var have_stock = 0

    ( 0 until days - 1 ).foreach{ i =>
      if( rates( i ) > rates( i + 1 ) ) {
        have_money += have_stock*rates( i )
        have_stock = 0
      }
      if( rates( i ) < rates( i + 1 ) ) {
        have_stock += have_money/rates( i )
        have_money = have_money%rates( i )
      }
    }

    have_money += have_stock*rates.last

    println( have_money )
  }
}