import Foundation

let n = Int(readLine()!)!
let prices = readLine()!
    .split(separator: " ")
    .map { Int($0)! }
var money = 1000
var stocks = 0

for i in 0 ..< n - 1 {
    if prices[i] > prices[i + 1] {
        // Sell
        money += stocks * prices[i]
        stocks = 0
    } else if prices[i] < prices[i + 1] {
        // Buy
        stocks += money / prices[i]
        money = money % prices[i]
    }
}

money += stocks * prices[n - 1]

print(money)
