N = int(input())
A = list(map(int, input().split()))

dp = [[[0]*2 for _ in range(2)] for _ in range(N)]

dp[0][0][0] = 1000
dp[0][1][0] = 1000%A[0]
dp[0][1][1] = 1000//A[0]

for i, a in enumerate(A):
  if i == 0:
    dp[0][0][0] = 1000
    dp[0][1][0] = 1000%a
    dp[0][1][1] = 1000//a
  else:
    if dp[i-1][0][0] < dp[i-1][1][0] + dp[i-1][1][1]*a:
      dp[i][0][0] = dp[i-1][1][0] + dp[i-1][1][1]*a
    else:
      dp[i][0][0] = dp[i-1][0][0]
    if dp[i-1][1][1] < dp[i][0][0]//a and dp[i-1][1][0] < dp[i][0][0]%a:
      dp[i][1][0] = dp[i][0][0]%a
      dp[i][1][1] = dp[i][0][0]//a
    else:
      dp[i][1][0] = dp[i-1][1][0]
      dp[i][1][1] = dp[i-1][1][1]
if dp[N-1][0][0] < dp[N-1][1][0] + dp[N-1][1][1]*A[N-1]:
  print(dp[N-1][1][0] + dp[N-1][1][1]*A[N-1])
else:
  print(dp[N-1][0][0])