n = gets.to_i
a = gets.split.map(&:to_i)
ans_m = 1000
ans_r = 0

(n-1).times do |i|
    if a[i] < a[i+1]
        ans_r =  ans_m/a[i]
        ans_m -= ans_r*a[i]
        ans_m +=  ans_r*a[i+1]
    end
end

p ans_m