import sys

n = int(input())
a = input().split()

money = 1000
stock = 0
pivot = []

for i in range(n-1):
    pivot.append(int(a[i+1]) - int(a[i]))

pivot.append(-1)

i=0

for j in range(n):
    if(pivot[j]>0):
        i = j
        break
    else:
        print("money=",money)
        sys.exit()

stock = int(money//int(a[i]))
money = int(money%int(a[i]))

i+=1

while(i<n):
    if(i==n-1):
        if(pivot[i-1]>0):
            money = money + stock*int(a[i])
            stock = 0
        sys.exit()

    if(pivot[i]<0):
        while(pivot[i+1]<=0):
            i+=1
        stock = int(money//int(a[i]))
        money = int(money%int(a[i]))
        i+=1
    else:
        while(pivot[i+1]>=0):
            i+=1
        money = money + stock*int(a[i+1])
        stock = 0
        i+=1

print(money)
