#include <bits/stdc++.h>
using namespace std;
mt19937 tw(566);
uniform_int_distribution<long long> ll_distr;
long long rnd(long long a, long long b) {
  return ll_distr(tw) % (b - a + 1) + a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<vector<long long>> dp(n, vector<long long>(1000000, LONG_LONG_MIN));
  dp[0][0] = 1000;
  vector<long long> a(n);
  for (int i = 0; i < int(n); i++) cin >> a[i];
  for (int i = 0; i < int(n - 1); i++) {
    for (int j = 0; j < int(1000000); j++) {
      if (dp[i][j] < 0) continue;
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + j * a[i]);
      dp[i + 1][j + (dp[i][j] / a[i])] =
          max(dp[i + 1][j + (dp[i][j] / a[i])], dp[i][j] % a[i]);
    }
  }
  long long ans = LONG_LONG_MIN;
  for (int j = 0; j < int(1000000); j++) {
    ans = max(ans, dp[n - 1][j] + j * a[n - 1]);
  }
  cout << ans << "\n";
  return 0;
}
