n=gets.to_i
a=gets.split.map(&:to_i)
m=1000
k=0
f="f"
d=a[0]
n.times do |i|
  if f=="f"
    if a[i]>d
      k+=m/d
      m%=d
      f="u"
    elsif a[i]<d
      d=a[i]
    end
  elsif f=="u"
    if a[i]<a[i-1]
      m+=k*a[i-1]
      k=0
      f="d"
    end
  elsif f=="d"
    if a[i]>a[i-1]
      k+=m/a[i-1]
      m%=a[i-1]
      f="u"
    end
  end
end
m+=k*a[-1]
puts m
