n = int(input())
a = list(map(int,input().split()))
v = []
before = 0
for i in a:
    if i!=before:v.append(i)
    before = i
money = 1000
stack = 0
if v[0]<v[1]:
    buy_point = [1]
else:
    buy_point = [0]
for i in range(1,len(v)-1):
    if v[i-1]  < v[i] < v[i+1]:
        buy_point.append(2)
    elif v[i-1]  > v[i] > v[i+1]:
        buy_point.append(0)
    elif v[i-1]  < v[i] and v[i] > v[i+1]:
        buy_point.append(-1)
    elif v[i-1]  > v[i] and v[i] < v[i+1]:
        buy_point.append(1)
    else:
        print('error')
if v[-2] < v[-1]:
    buy_point.append(-1)
else:
    buy_point.append(0)

for (i,j) in zip(v,buy_point):
    if j == 1:
        stack += money//i
        money = money%i
    elif j == -1:
        money += stack * i
        stack = 0
    elif j == 2:
        stack += money//i
        money = money%i
        
print(money)