from collections import Counter
n = int(input())
A = list(map(int, input().split()))
a = Counter(A)
cnt = 0
money = 1000
b = [0,0]
for i in range(n):
    a[A[i]] -= 1
    if a[A[i]] == 0: a.pop(A[i])

    flag = False
    if b[0] == 0 and b[1]!= A[i]:
        for j in a.keys():
            if A[i] < j:
                flag = True
                break
        if flag:
            cnt += money//A[i]
            money %= A[i]
            b = [A[i], A[i]]
    elif b[0] < A[i] and b[1]!=A[i]:
        money += cnt * A[i]
        cnt, b = 0, [0,A[i]]

print(money)