n=int(input())
a=list(map(int,input().split()))
flg=0
l=[]
m,k=1000,0
for i in range(n-1):
    if flg==0:
        if a[i+1]>a[i]:
            l.append((flg,i))
            flg=1
    else:
        if a[i+1]<a[i]:
            l.append((flg,i))
            flg=0
if a[n-1]>a[n-2]:
    l.append((1,n-1))
for flg,i in l:
    if flg==0:
        k+=m//a[i]
        m-=(m//a[i])*a[i]
    else:
        m+=k*a[i]
        k=0
print(m)