#include <bits/stdc++.h>
using namespace std;
constexpr int INF = INT_MAX >> 1;
constexpr long long LINF = 5000000000000000LL;
constexpr int MOD = 1000000007;
long long dp[100][110000];
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  for (int i = 0; i < (n + 1); i++)
    for (int j = 0; j < (110000); j++) dp[i][j] = -1;
  dp[0][0] = 1000;
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (110000); j++) {
      if (dp[i][j] == -1) continue;
      int k = dp[i][j] / a[i];
      dp[i + 1][j + k] = max(dp[i + 1][j + k], dp[i][j] - k * a[i]);
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + j * a[i]);
    }
  cout << dp[n][0] << endl;
}
