n = gets.to_i
A = gets.split(" ").map(&:to_i)
money = 1000
kabu = 0

# i
# A[i] < A[i + 1] => 売却なし　購入
# A[i] > A[i + 1] => 売却　購入なし

(n - 1).times do |i|
  #購入
  if (A[i] < A[i + 1])
    c = money / A[i]
    kabu += c
    money -= c * A[i]
    #売却
  elsif (A[i] > A[i + 1])
    money += kabu * A[i]
    kabu = 0
  end
end

money += kabu * A[n - 1]
print money
