#include <bits/stdc++.h>
using namespace std;
const int_fast32_t inf = 1e9 + 7;
const int_fast32_t MOD = 1000000007;
const int_fast64_t llinf = 1e18;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int_fast32_t n;
  cin >> n;
  vector<int_fast64_t> a(n);
  for (int_fast64_t i = 0; i < (n); ++i) cin >> a[i];
  vector<vector<pair<int_fast64_t, int_fast64_t>>> dp(
      n + 1, vector<pair<int_fast64_t, int_fast64_t>>(2));
  dp[0][0] = pair<int_fast64_t, int_fast64_t>(1000, 0);
  for (int_fast64_t i = 0; i < (n); ++i) {
    dp[i + 1][0] = pair<int_fast64_t, int_fast64_t>(
        max(dp[i][0].first + dp[i][0].second * a[i],
            dp[i][1].first + dp[i][1].second * a[i]),
        0);
    if (dp[i][0].second + dp[i][0].first / a[i] >
        dp[i][1].second + dp[i][1].first / a[i])
      dp[i + 1][1] = pair<int_fast64_t, int_fast64_t>(
          dp[i][0].first % a[i], dp[i][0].second + dp[i][0].first / a[i]);
    else
      dp[i + 1][1] = pair<int_fast64_t, int_fast64_t>(
          dp[i][1].first % a[i], dp[i][1].second + dp[i][1].first / a[i]);
  }
  cout << (max(dp[n][0].first, dp[n][1].first)) << "\n";
  return 0;
}
