#include <bits/stdc++.h>
using namespace std;
long long dp[82][40010];
int arr[82];
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &arr[i]);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 1000;
  for (int i = 1; i <= n; i++) {
    int buy = dp[i - 1][0] / arr[i];
    int yu = dp[i - 1][0] - arr[i] * buy;
    dp[i][buy] = max(yu, dp[i][buy]);
    for (int j = 0; j <= 40000; j++) {
      dp[i][j] = max(dp[i - 1][j], dp[i][j]);
    }
    for (int j = 1; j <= 40000; j++) {
      if (dp[i - 1][j] >= 0) {
        dp[i][0] = max(dp[i][0], dp[i - 1][j] + j * arr[i]);
      }
    }
  }
  long long ans = -1;
  for (int i = 0; i <= 40000; i++) ans = max(ans, dp[n][i]);
  cout << ans << endl;
  return 0;
}
