function cal(mon,num,i,A,N)
#for i in 1:N
#println(mon)
  if i == N
    mon += num*A[i]
    num = 0
  #elseif A[i] == maximum(A[i:N])
  #   mon += num*A[i]
  #   num = 0
  #   println(mon)
  #   exit()
  else
#    if i == 1
#      num += div(mon,A[i])
#      mon -= num*A[i]
#else
    if A[i] > A[i+1]
      mon += num*A[i]
      num = 0
    elseif A[i] < A[i+1]
      num += div(mon,A[i])
      mon -= num*A[i]
    end
  end
return num,mon
end

parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function main()
N = parseInt(readline())
A = parseMap(split(readline()))
mon=1000 ; num=0
#if A[1] == maximum(A)
#  println(1000)
#  exit()
#end
for i in 1:N
  num,mon=cal(mon,num,i,A,N)
end
println(mon)
end
main()
