#include <bits/stdc++.h>
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  vector<vector<long long>> dp(n + 1, vector<long long>(5000 * n, 0));
  vector<vector<bool>> ok(n + 1, vector<bool>(5000 * n, false));
  dp[0][0] = 1000;
  ok[0][0] = true;
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (n * 5000); j++) {
      if (!ok[i][j]) continue;
      chmax(dp[i + 1][0], dp[i][j] + a[i] * j);
      ok[i + 1][0] = true;
      long long now = dp[i][j] / a[i];
      chmax(dp[i + 1][j + now], dp[i][j] % a[i]);
      ok[i + 1][j + now] = true;
    }
  }
  long long ans = 0;
  cout << dp[n][0] << endl;
}
