
import Foundation
let N = Int(readLine()!)!
let input = readLine()!.components(separatedBy: " ").map{ Int($0)! }
var money = 1000
var stock = 0


for i in 0...N - 1 {
    if i == N - 1 {
        if stock != 0 {
                   money = stock * input[i]
                   stock = 0
               }
        print(money)
    }else if input[i] < input[i + 1] {
        stock = money / input[i]
        money = money % input[i]
    } else if input[i] >= input[i + 1] {
        if stock != 0 {
            money = stock * input[i]
            stock = 0
        }
    } else {
        
    }
}