let N = Int(readLine()!)!
let AN = readLine()!.split(separator: " ").compactMap { Int($0) }

var money = 1000
for i in 0..<N-1 {
    if AN[i] < AN[i+1] {
        money += Int(money/AN[i])*(AN[i+1]-AN[i])
    }
}
print(money)
