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

m, b, t = 1000, 0, true
(0..(N-2)).each{|i|
  if A[i] < A[i+1] && t then
    b += m/A[i]
    m = m % A[i]
    t = false
  elsif A[i] > A[i+1] && !t then
    m += b * A[i]
    b = 0
    t = true
  end
}

puts m + b*A[N-1]
