N=int(input())
a=list(map(int,input().split()))
tmp=a[0]
up=0
check=0
stock=0
n=1000
for i in range(N-1):
    if i==0:
        if a[i]<=a[i+1]:
            check=1
            stock=n//a[i]
            n-=stock*a[0]
        else:
            ckeck=2
    else:
        if check==1:
            if a[i]<=a[i+1]:
                pass
            else:
                check=2
                n+=stock*a[i]
                stock=0
        elif check==2:
            if a[i]<=a[i+1]:
                check=1
                stock=n//a[i]
                n-=stock*a[i]
    #print(n,stock,check)
if check==1:
    n+=stock*a[-1]
print(n)