func readIntList() -> [Int] {
    return readLine()!.split(separator: " ").map{Int($0)!}
}

func readInt() -> Int {
    return Int(readLine()!)!
}
func main() {
    let n = readInt()
    let aList = readIntList()
    var baget = 1000
    var stock = 0
    for i in 1...n {
        let nextPrice = aList[i+1-1]
        let nowPrice = aList[i-1]
        if stock > 0 {
            if  nextPrice >= nowPrice {
                continue
            } else {
                // sell
                baget += stock * nowPrice
                stock = 0
            }
        } else { // stock == 0
            if nextPrice <= nowPrice {
                continue
            } else {
                // buy
                stock = baget / nowPrice
                baget -= stock * nowPrice
            }
        }
    }
    if stock > 0 {
        baget += stock * aList[n-1]
    }
    print(baget)
}

main()

