n = gets.to_i
a = gets.split.map(&:to_i)

vs = Array.new(0)
vs.push(a[0])
id = 0

mode = 0 # search: 0..down, 1..up
for i in 1..(n-1)
  if mode == 0
    if vs[id] > a[i]
      vs[id] = a[i]
    elsif vs[id] < a[i]
      vs.push(a[i])
      id += 1
      mode = 1
    end
  elsif mode == 1
    if vs[id] < a[i]
      vs[id] = a[i]
    elsif vs[id] > a[i]
      vs.push(a[i])
      id += 1
      mode = 0
    end
  end
end

id -= 1 if id % 2 == 0
mon = 1000
cnt = 0
for i in 0..id
  if i % 2 == 0
    cnt = mon / vs[i]
    mon -= vs[i]*cnt   
  else
    mon += cnt*vs[i]
    cnt = 0
  end
end
puts mon