let n = Int(readLine()!)!
 
let a = readLine()!.split(separator: " ").map { Int($0)! }
 
var stocks = 0
var money = 1000
 
for i in 0..<n-1 {
  if a[i] < a[i + 1] {
    // buy
    stocks += money / a[i]
    money = money % a[i]
  } else if a[i] > a[i + 1] {
    //sell
    money += stocks * a[i]
    stocks = 0
  }
}

//sell
money += stocks * a[n-1]
 
print(money)