#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
void prtok(bool ok) { cout << (ok ? "Yes" : "No") << "\n"; }
int main(void) {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = (long long)0; i < (long long)n; i++) {
    cin >> a[i];
  };
  vector<vector<long long>> dp(n + 1, vector<long long>(4000, -1));
  dp[0][0] = 1000;
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    for (long long j = (long long)0; j < (long long)4000; j++) {
      if (dp[i - 1][j] < 0) break;
      for (long long k = (long long)0; k < (long long)4000; k++) {
        long long num = k - j;
        if (num * a[i - 1] > dp[i - 1][j]) break;
        dp[i][k] = max(dp[i][k], dp[i - 1][j] - num * a[i - 1]);
      }
    }
  }
  cout << (dp[n][0]) << "\n";
}
