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

m=1000

if A[0]<max(A[1:]):
    tmp = A[0]
    stock=m//A[0]
    m-=A[0]*stock
    
    for i,ai in enumerate(A[1:]):
        if tmp>ai:
            m+=tmp*stock
            stock=0
            if ai < max(A[i:]):
                stock=m//ai
                m-=ai*stock
        tmp = ai
    print(m+stock*A[-1])
else:
    print(m)