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

    if cnt > 0 and before < A[i]:
        money += cnt * A[i]
        cnt = 0
        before = A[i]
    elif before != A[i]:
        flag = False
        for x,y in a.items():
            if x > A[i]:
                flag = True
                break
        if flag:
            before = A[i]
            cnt += money//A[i]
            money %= A[i]
        else:
            before = A[i]
            money += cnt * A[i]

print(money)