N = gets.to_i
A = gets.split.map(&:to_i)
A << 0
x = 1000
y = 0
N.times{|d|
    if A[d] < A[d + 1]
        a = x / A[d]
        y += a
        x -= a * A[d]
    elsif A[d] > A[d + 1]
        x += y * A[d]
        y = 0
    end
}
puts x
