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