n = int(input())
a = list(map(int, input().split()))

money = 1000
max_money = money

open_price = a[0]
close_price = a[0]

for i in range(1, n):
	if a[i] >= a[i - 1]:
		close_price = a[i]
	else:			
		#print(i, a[i])
		#print(open_price, close_price)
		num = money // open_price
		left = money - num * open_price
		money = left + num * close_price
		max_money = max(money, max_money)
		open_price = a[i]
		close_price = 0
		#print(money)

num = money // open_price
left = money - num * open_price
money = left + num * close_price
max_money = max(money, max_money)

print(max_money)