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

money=1000
stocks=0

for i in range(N): 
    if i==N-1:
        #売る
        while stocks>0:
            money += A[i]
            stocks-=1    
    elif A[i+1]>A[i]:
        #買う
        while money>=A[i]:
            money -= A[i]
            stocks+=1
    elif A[i+1]<A[i]:
        #売る
        while stocks>0:
            money += A[i]
            stocks-=1
print(money)