n=int(input())
A=list(map(int,input().split()))
money=1000
stock=0
a=[A[0]]
for i in range(1,n):
    if A[i]!=A[i-1]:
        a.append(A[i])
if len(a)!=1:
    for i in range(len(a)):
        try:
            if a[i-1]>=a[i] and a[i]<=a[i+1]:
                stock+=money//a[i]
                money%=a[i]
            elif a[i-1]<=a[i] and a[i]>=a[i+1]:
                money+=a[i]*stock
                stock=0

        except:
            if i==0:
                if a[i]<=a[i+1]:
                    stock+=money//a[i]
                    money%=a[i]
            else:
                money+=a[i]*stock
                stock=0
print(money)