n = int(input())
A = list(map(int, input().split()))
cnt = 0
money = 1000
before = 0
for i in range(n-1):
    if A[i] < A[i+1] and before == 0:
        cnt += money//A[i]
        money %= A[i]
        before = A[i]
    else:
        if before < A[i]:
            money += cnt * A[i]
            cnt = 0
            before = 0
if cnt > 0:
    money += cnt * A[-1]
print(money)