#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e16;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<vector<long long> > dp(n + 1, vector<long long>(200005, -inf));
  dp[0][0] = 1000;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < 2005; j++) {
      long long x = dp[i][j];
      if (x == -inf) continue;
      long long b = x / a[i];
      dp[i + 1][j] = max(dp[i + 1][j], x);
      for (long long k = 0; k < b + 1; k++)
        dp[i + 1][j + k] = max(dp[i + 1][j + k], x - k * a[i]);
      for (long long k = 0; k < j + 1; k++)
        dp[i + 1][j - k] = max(dp[i + 1][j - k], x + k * a[i]);
    }
  }
  cout << *max_element(dp[n].begin(), dp[n].end()) << endl;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  solve();
}
