inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
N = inp.shift() * 1
a = inp.shift().split(' ').map(x => +x)
m = 1000
for (i=0; i<N; i++) {
    min = a[i]
    max = a[i]
    for (j=i; j<N; j++) {
        if (max > a[j]) {
            break;
        }
        max = a[j]
    }
    c = parseInt(m / min)
    m += (max - min) * c
    i = j
}
console.log(m)