n = int(input())
A = list(map(int, input().split()))

cnt = 0
money = 1000
b = 0
for i in range(n):
    if i!=0:
        if A[i-1] == A[i]: continue
    if b == 0:
        cnt += money//A[i]
        money %= A[i]
        b = A[i]
    elif b < A[i]:
        money += cnt * A[i]
        cnt = 0
        b = 0
if cnt > 0:
    money += cnt * b
print(money)