N = gets.to_i
A = gets.split.map(&:to_i)

stock = 0
ans = 1000

(N-1).times do |i|
  if (A[i] < A[i+1])
    stock = ans / A[i]
    ans %= A[i]
  elsif (A[i] > A[i+1])
    ans += stock * A[i]
    stock = 0
  end
end

puts (ans + stock * A.last)