N = int(input())
A = list(map(int,input().split()))
m = 1000
s = 0
flag = 0
a = A[0]
for i in range(N):
    if A[i]>a and flag==0:
        n = m//a
        s += n
        m -= n*a
        flag = 1
        a = A[i]
    elif A[i]<a and flag==1:
        m += s*a
        s = 0
        flag = 0
        a = A[i]
if flag==1:
    m += s*A[-1]
print(m)