n=int(input())
l=[int(i) for i in input().split()]
y=1000
c=0
m=0
c2=0
for i in range(n):
    c1=0
    for j in range(n):
        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(y)