def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end
def debug(k,v) puts "#{k}: #{v}" end
def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end


n = gi #10**3
as = gsmi

now = 1000
kabu = 0

as.each_cons(2) do |a,a2|
  if a2>a
    kabu, now = now/a, now%a
  else
    kabu, now = 0, now+a*kabu
  end
end
kabu, now = 0, now+as[-1]*kabu
puts now
