n = gets.to_i
a = gets.split.map(&:to_i)
cash = 1000
stock = 0
0.upto(n-2){|i|
  if a[i] < a[i+1]
    stock = cash/a[i]
    cash -= stock*a[i]
  elsif a[i] > a[i+1]
    cash += stock*a[i]
    stock = 0
  end
}
if stock!=0
  cash += stock*a[n-1]
  stock = 0
end
p cash
