n = gets.to_i
a = gets.split.map { |t| t.to_i }

m = 1000
k = 0

b = []
a.each_with_index do |t, i|
  # p [t, i]
  if (i == 0 || a[i-1] >= t) && (i+1 < n && t < a[i+1])
    b << t
  elsif (a[i-1] < t) && (i == n-1 || t >= a[i+1])
    b << t
  end
end

b.pop if b.size.odd?
b.each_with_index do |t, i|
  if i.even?
    k_add = m / t
    k += k_add
    m -= t * k_add
  else
    m_add = k * t
    k = 0
    m += m_add
  end
  # p m
end

puts m