n = gets.to_i
a = gets.split.map(&:to_i)
m = 1000


b = 0
s = 0
for i in 1...a.size do
  if a[b]<a[i]&&(i==a.size-1||a[i+1]<a[i])
    s = i
    num = m/a[b]
    m = m-(a[b]*num)+(a[i]*num)
    b = i+1
  elsif a[b]>a[i]
    b = i
  end
end

puts m