def stockBuySell(price, n): 

	if (n == 1): 
		return
	i = 0
	while (i < (n - 1)): 
		while ((i < (n - 1)) and
				(price[i + 1] <= price[i])): 
			i += 1

		if (i == n - 1): 
			break
		quantity = money//price[i]
		money = money//quantity

		while ((i < n) and (price[i] >= price[i - 1])): 
			i += 1
			
		money = quantity*price[i-1]
		quantity = 0
		
		
n = int(input())
price = list(map(int, input().split()))
quantity = 0
money = 1000
stockBuySell(price, n) 
print(money)

