#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const char NL = '\n';
const int MOD = 1e9 + 7;
int backtrack(vector<int> &a, int i, int yens, int stocks) {
  if (i == a.size()) return yens;
  int o1 = backtrack(a, i + 1, yens, stocks);
  int price = a[i];
  int o2 =
      backtrack(a, i + 1, yens - (yens / price) * price, stocks + yens / price);
  int o3 = backtrack(a, i + 1, yens + stocks * price, 0);
  return max({o1, o2, o3});
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << backtrack(a, 0, 1000, 0) << NL;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
