n=int(input())
a=list(map(int, input().split()))

money=1000

chart=[a[0]]
flag=0

for i in range(n):
    if flag==0:
        if a[i]>chart[-1]:
            chart.append(a[i])
            flag=1

    else:
        if a[i]<chart[-1]:
            cnt=0
            M=0
            for j in range(i, n+1):
                if a[i]<a[j]:
                    cnt+=1
                    if M<a[j]:
                        M=a[j]
            
            if cnt==0:
                break
            elif cnt==1:
                chart.append(M)
                break
            else:
                flag=0

days=len(chart)

for day in range(days):
    if day%2==0:
        contact=money//chart[i]
        money-=contact*chart[i]
    
    else:
        money+=contact*chart[i]

print(money)