#include <bits/stdc++.h>
using namespace std;
long long int INF = 10000000000;
int main(int argc, char const *argv[]) {
  long long int n;
  std::cin >> n;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) std::cin >> a[i];
  long long int MAX = 1000000;
  vector<vector<long long int>> dp =
      vector<vector<long long int>>(n + 1, vector<long long int>(MAX, -INF));
  dp[0][0] = 1000;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < MAX; j++) {
      long long int en = dp[i][j];
      if (en == -INF) continue;
      long long int num = (en / a[i]);
      dp[i + 1][j + num] = max(dp[i + 1][j + num], dp[i][j] - num * a[i]);
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + j * a[i]);
    }
  }
  long long int ans = 0;
  for (int i = 0; i < MAX; i++) ans = max(ans, dp[n][i]);
  std::cout << ans << '\n';
  return 0;
}
