#D
N=int(input())
A=list(map(int,input().split()))
B=[]

for i in range(N-1):
    if A[i+1]>A[i]:
        B.append(["up",i])
    elif A[i+1]<A[i]:
        B.append(["down",i])
        
C=[]
for i in range(len(B)-1):
    if B[i][0]==B[i+1][0]:
        continue
    C.append(B[i])
C.append(B[-1])

while True:
    if C==[]:
        break
    if C[-1][0]=="down":
        C.pop(-1)
    else:
        break
        
kabu=0
money=1000
if C!=[]:
    if C[0][0]=="up":
        kabu+=money//A[0]
        money%=A[0]
for act in C:
    if act[0]=="up":
        money+=A[act[1]+1]*kabu
        kabu=0
    else:
        kabu+=money//A[act[1]+1]
        money%=A[act[1]+1]
print(money)