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

low = 0
high = 0

ans = 1000
while A.size > 1
  loop do
    low = A.shift
    break if !A[0] || low < A[0]
  end
  break unless low && A[0]
  loop do
    high = A.shift
    break if !A[0] || A[0] < high
  end
  break unless high

  n = ans / low
  ans -= low * n
  ans += high * n
end
puts ans