NN = int(input())
A = list(map(int,input().split()))
money = 1000
n_of_kabu = 0
slope = [0] * (NN-1)
action = ['hold'] * (NN-1)
for i in range(NN-1):
    if A[i+1] >= A[i]:
        slope[i] = 1
    elif A[i+1] < A[i]:
        slope[i] = -1
    else:
        slope[i] = 0
#print(slope)

mymin = min(A[0:NN-1])
mymax = max(A[0:NN-1])
if (A[0] == mymin) & (A[0] < A[NN-1]):
    action[0] = 'buy'

for i in range(0,NN-1):
    if (slope[i] == -1) and (slope[i-1] == 1):
        action[i] = 'sell'
    elif (slope[i] == 1) and (slope[i-1] == -1):
        action[i] = 'buy'
#print(action)

for i in range(NN-1):
    if action[i] == 'buy':
        add_n_of_kabu = int(money/A[i])
        money = money - add_n_of_kabu * A[i]
        n_of_kabu = n_of_kabu + add_n_of_kabu
    elif action[i] == 'sell':
        money = money + n_of_kabu * A[i]
        n_of_kabu = 0
#    print(money, n_of_kabu, A[i])
print(money + n_of_kabu * A[NN-1])