#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int n = 0; n < N; ++n) {
    cin >> A[n];
  }
  int now = 1000;
  vector<vector<int>> dp(N + 1, vector<int>(30000, -1));
  dp[0][0] = 1000;
  for (int n = 0; n < N; ++n) {
    for (int m = 0; m < 20000; ++m) {
      if (-1 != dp[n][m]) {
        for (int l = 0; l <= dp[n][m] / A[n]; ++l) {
          dp[n + 1][m + l] = max(dp[n + 1][m + l], dp[n][m] - A[n] * l);
        }
        for (int l = 0; l <= m; ++l) {
          dp[n + 1][m - l] = max(dp[n + 1][m - l], dp[n][m] + A[n] * l);
        }
      }
    }
  }
  int ans = 0;
  for (int m = 0; m < 30; ++m) {
    ans = max(ans, dp[N][m]);
  }
  cout << ans << endl;
  return 0;
}
