import math
N = int(input())
A = list(map(int, input().split()))
C = 1
m = A[0]
M = A[0]
money = 1000;
for i in range(1,N):
  if C == 1 and M <= A[i]:
    M = A[i]
  elif C == 1 and M > A[i]:
    money = (money % m) + math.floor(money / m)*M
    C = 0
    m = A[i]
    print(money)
  elif C == 0 and m >= A[i]:
    m = A[i]
  elif C == 0 and m < A[i]:
    M = A[i]
    C = 1
if C == 1:
  money = (money % m) + math.floor(money / m)*M
  print(money)