n=int(input())
l=[int(i) for i in input().split()]
k=max(l)
k1=l.index(k)
l=sorted(l[:k1+1])
if(l[0]==k):
    print(1000)
else:
    y=1000
    c=0
    m=0
    c2=0
    for i in range(k1):
        c1=0
        for j in range(k1):
            if(l[j]>l[i]):
                c1=1
                break
        if(c1==0 and m==0):
            break
        elif(c1==0 and m==1):
            y+=(l[i]*c)
            break
        else:
            if(m==0):
                if(c2!=0):
                    if(l[i]<k1):
                        m=1
                        c=y//l[i]
                        y%=l[i]
                        k=l[i]
                else:
                    c2=1
                    m=1
                    c=y//l[i]
                    y%=l[i]
                    k=l[i]
            else:
                if(l[i]>k):
                    y+=(l[i]*c)
                    k1=l[i]
                    m=0
    print(max(y,(l[k1]*(1000//l[0]))))