N = int(input())
A = list(map(int, input().split()))
ans = 1000
i = 0
while(len(A) - i > 1):
    s = [s for s in A[i + 1:] if s > A[i]]
    if len(s) == 0:
        break
    si = A.index(s[0])
    b = min(A[i:si])
    stock = ans // b
    ans %= b
    ans += (stock * s[0])
    i = si + 1
    
print(ans)