#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
int main() {
  ll n;
  cin >> n;
  vector<ll> v(n);
  for (ll i = 0; i < (ll)n; i++) cin >> v[i];
  vector<vector<ll>> dp(n + 1, vector<ll>(1000000, -1));
  dp[0][0] = 1000;
  for (ll i = 0; i < (ll)n; i++)
    for (ll j = 0; j < (ll)1000000; j++) {
      if (dp[i][j] == -1) continue;
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      if (j + (dp[i][j]) / v[i] < 1000000)
        dp[i + 1][j + (dp[i][j] / v[i])] =
            max(dp[i + 1][j + (dp[i][j] / v[i])], (dp[i][j] % v[i]));
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + j * v[i]);
    }
  ll res = 0;
  for (ll i = 0; i < (ll)1000000; i++)
    if (dp[n][i] != -1) res = max(res, dp[n][i] + i * v.back());
  cout << res << endl;
  return 0;
}
