#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<vector<int>> dp(N + 1, vector<int>(100, 0));
  vector<vector<bool>> can(N + 1, vector<bool>(100, false));
  can[0][0] = true;
  dp[0][0] = 1000;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 100; j++) {
      if (!can[i][j]) continue;
      for (int k = 0; k < 100; k++) {
        if (dp[i][j] >= (k - j) * A[i]) {
          chmax(dp[i + 1][k], dp[i][j] - (k - j) * A[i]);
          can[i + 1][k] = true;
        }
      }
    }
  }
  cout << dp[N][0] << "\n";
  return 0;
}
