const input = require("fs").readFileSync("/dev/stdin", "utf8")

;(input => {

    const lines = input.split('\n')
    let N = lines[0] - 0
    const A = lines[1].split(' ').map(Number)

    let h = 0
    let m = 1000

    for (let i = 0; i < N - 1; i++) {
        if (A[i] < A[i + 1]) {
            const n = Math.floor(m / A[i])
            h += n
            m -= A[i] * n
        } else if (A[i] > A[i + 1]) {
            m += A[i] * h
            h = 0
        }
    }

    m += A[N -1] * h

    console.log(m)

})(input)
