N = int(input())
A = list(map(int, input().split()))
X = [A[0]]
for i in range(1, N):
  if A[i] != A[i-1]:
    X.append(A[i])
B, C = [], []
n = len(X)
if n==1:
  print(1000)
else:
  status = 0
  result = 1000
  now_m = 1000
  k = 0
  if X[0]>X[1]:
    B.append(0)
  else:
    C.append(0)
  for i in range(1, n-1):
    if X[i-1]<X[i] and X[i]>X[i+1]:
      B.append(i)
  for i in range(1, n-1):
    if X[i-1]>X[i] and X[i]<X[i+1]:
      C.append(i)
  if X[n-2]<X[n-1]:
    B.append(n-1)
  else:
    C.append(n-1)
  S = set(B+C)
  for s in S:
    if status==0:
        k = now_m//X[s]
        now_m -= k*X[s]
        status = 1
    else:
        now_m += k*X[s]
        result = max(result, now_m)
        k = 0
        status = 0
  print(result)