#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int n;
map<pair<int, pair<long long, bool>>, long long> mp;
long long brute(int day, long long amount, bool operation) {
  if (day == n) {
    if (operation)
      return amount;
    else
      return 0;
  }
  if (mp.find({day, {amount, operation}}) != mp.end())
    return mp[{day, {amount, operation}}];
  long long a = 0, b = 0;
  if (operation)
    a = amount - (amount / v[day]) * v[day] +
        brute(day + 1, amount / v[day], false);
  else
    a = brute(day + 1, v[day] * amount, true);
  b = brute(day + 1, amount, operation);
  mp.insert({{day, {amount, operation}}, max(a, b)});
  return max(a, b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  v = vector<long long>(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  cout << brute(0, 1000, true) << endl;
  return 0;
}
