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