N = int(input())
A = list(map(int,input().split()))
ans = 1000
s = A[0]
S = A[0]
for i in range(1,N):
    if s > A[i]:
        s = A[i]
    elif S <= A[i]:
        S = A[i]
    else:
        t = ans//s
        ans = ans % s
        ans += t*S
        if i == N-1:
            break
        s,S = A[i+1],A[i+1]
    if i == N-1 and s < A[i]:
        t = ans//s
        ans = ans % s
        ans += t*A[i]
print(ans)