#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  vector<vector<P>> dp(n + 1, vector<P>(2, {0, 0}));
  dp[0][0] = {0, 1000};
  dp[0][1] = {0, 1000};
  for (int i = 0; i < n; i++) {
    int s = dp[i][1].first;
    int y = dp[i][1].second;
    s += y / a[i];
    y -= (y / a[i]) * a[i];
    if (s > dp[i][0].first) {
      dp[i + 1][0] = {s, y};
    } else {
      dp[i + 1][0] = dp[i][0];
    }
    s = dp[i][0].first;
    y = dp[i][0].second;
    y += s * a[i];
    s = 0;
    if (y > dp[i][1].second) {
      dp[i + 1][1] = {s, y};
    } else {
      dp[i + 1][1] = dp[i][1];
    }
  }
  cout << dp[n][1].second << endl;
}
