#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const double PI = 3.14159265358979323846264338327950;
inline int newline() {
  putchar('\n');
  return 0;
}
int main() {
  int n;
  cin >> n;
  ;
  vector<int> a(n);
  for (ll i = 0; i < n; ++i) cin >> a[i];
  ;
  vector<vector<int>> dp(n, vector<int>(n, 1000));
  for (ll i = 0; i < n; ++i) {
    for (ll j = i; j < n; ++j) {
      if (i == 0 && j == 0) continue;
      if (i == j) {
        dp[i][j] = dp[i - 1][j];
        continue;
      }
      if (i == 0) {
        int left = 1000 % a[i];
        dp[i][j] = left + 1000 / a[i] * a[j];
      } else {
        int left = dp[i][i] % a[i];
        int sum = left + dp[i][i] / a[i] * a[j];
        dp[i][j] = max(dp[i - 1][j], max(dp[i][j - 1], sum));
      }
    }
  }
  if (dp[n - 1][n - 1] > 1000) {
    cout << dp[n - 1][n - 1] << endl;
    ;
  } else {
    cout << "1000" << endl;
    ;
  }
  return 0;
}
