#include <bits/stdc++.h>
using namespace std;
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() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  int dp[n + 1];
  dp[0] = 1000;
  int max_dp = 1000;
  for (int t = 1; t < (int)(n + 1); t++) {
    for (int i = 0; i < t - 1; i++) {
      for (int j = i + 1; j < t; j++) {
        max_dp = max(max_dp, dp[i] / a[i] * a[j] + dp[i] % a[i]);
      }
    }
    dp[t] = max_dp;
    max_dp = 1000;
  }
  cout << dp[n] << endl;
  return 0;
}
