let n = Int(readLine()!)!

let a = readLine()!.split(separator: " ").map { Int($0)! }

var stocks = 0
var money = 1000

for i in 1..<n {
  //print(money)
  if a[i-1] < a[i] {
    // buy
    let count = money / a[i-1]
    stocks += count
    money -= count * a[i-1]
    if i == n - 1 {
       money += stocks * a[i]
       stocks = 0  
    }
  } else if a[i-1] > a[i] {
    //sell
    money += stocks * a[i - 1]
    stocks = 0
  }
}


print(money)