#include <bits/stdc++.h>
using namespace std;
int dp[80];
vector<int> v;
int dp_solve(int j) {
  if (dp[j] != 0) return dp[j];
  if (j == 0) return 1000;
  int best = 0;
  for (int i = 0; i < j; ++i) {
    int cash = dp_solve(i);
    int stocks = (int)floor((double)cash / (double)v[i]);
    cash = cash % v[i];
    cash += (int)floor((double)stocks * (double)v[j]);
    best = max(cash, best);
  }
  dp[j] = max(best, dp_solve(j - 1));
  return dp[j];
}
void solve() {
  int n;
  cin >> n;
  v.resize(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  cout << dp_solve(n) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
