import numpy as np
import itertools
#from scipy import signal


n = int(input())
ajs = input().split()
ajs = [int(aj) for aj in ajs]
ajs = np.array(ajs)

#actions = itertools.product([-1, 0, 1], repeat=n)
#for action in actions:

ajs_delta = ajs[1:] - ajs[:-1]
print(ajs_delta)
for i in range(1, ajs_delta.shape[0]):
  if ajs_delta[i] == 0:
    ajs_delta[i] = ajs_delta[i-1]
    
print(ajs_delta)
  
kyokuchi = {'lower':[], 'upper':[]}
#maxId = signal.argrelmax(ajs)

first_value = 0
for aj_delta in ajs_delta:
  if aj_delta != 0:
    first_value = aj_delta
    break

if ajs_delta[0] > 0:
  kyokuchi['lower'].append(0)
elif ajs_delta[0] < 0:
  kyokuchi['upper'].append(0)
elif ajs_delta[0]  == 0 and first_value > 0:
  kyokuchi['lower'].append(0)

for i in range(0, ajs_delta.shape[0]-1):
  if ajs_delta[i] * ajs_delta[i+1] < 0:
    if ajs_delta[i] > 0:
      kyokuchi['upper'].append(i+1)
    else:
      kyokuchi['lower'].append(i+1)

if ajs_delta[-1] > 0:
  kyokuchi['upper'].append(n-1)
else:
  kyokuchi['lower'].append(n-1)


kyokuchi_s = sorted(kyokuchi['upper'] + kyokuchi['lower'])
  
current_money = 1000
pos = 0

for idx in kyokuchi_s:
  if pos >= 0:#買い
    stock = int(current_money / ajs[idx])
    current_money = current_money % ajs[idx]
    pos = -1
  else:
    current_money += stock * ajs[idx]
    stock = 0
    pos = 1
    
print(current_money)