n=int(input())
A=[int(i) for i in input().split()]
T=[]

flg=-1
for i in range(n-1):
    if A[i]<A[i+1] and flg==-1:
        flg=1
        T.append(A[i])
    elif A[i]>A[i+1] and flg==1:
        flg=-1
        T.append(A[i])

if A[-2]<=A[-1]:
    T.append(A[-1])

kab=0
mon=1000

for i in range(len(T)):
    if i%2==0:
        kosuu=mon//T[i]
        kab+=kosuu
        mon-=kosuu*T[i]
    else:
        mon+=kosuu*T[i]
        kab=0

print(mon)