from collections import Counter 
n = int(input())
A = list(map(int, input().split()))
a = Counter(A)

cnt = 0
money = 1000
b = 0
c = 0
for i in range(n):
    a[A[i]] -= 1
    if a[A[i]] == 0: a.pop(A[i])
    if A[i-1] == A[i]: continue

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