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

@m = 1000
@k = 0
p = A[0]
s = 'buy'

def buy(i)
  @k += @m / A[i]
  @m -= @k * A[i]
end

def sell(i)
  @m += @k * A[i]
  @k = 0
end

N.times do |i|
  begin
    if s == 'buy'
      if A[i] <= p
        next
      else
        buy(i-1)
        s = 'sell'
      end
    else
      if A[i] >= p
        next
      else
        sell(i-1)
        s = 'buy'
      end
    end
  ensure
    p = A[i]
    if i == N - 1
      sell(i)
    end
  end
end

puts "#{@m}"
