#include <bits/stdc++.h>
using namespace std;
using G = vector<vector<int>>;
using M = map<int, int>;
using P = pair<int, int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct {
  int to;
  int cost;
};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int n;
vector<int> a;
vector<ll> visited;
ll ans = 1000;
void dfs(int d, int s, ll money) {
  if (d >= n) {
    ll re = s * a[d] + money;
    if (re > ans) ans = re;
    return;
  }
  ll tot = money + s * a[d];
  if (tot < visited[d]) return;
  int b_s = s + money / a[d];
  ll b_money = money - a[d] * (money / a[d]);
  ll b_tot = b_s * a[d] + b_money;
  if (tot <= b_tot) {
    dfs(d + 1, b_s, b_money);
  }
  ll s_money = money + a[d] * s;
  if (tot <= s_money) {
    dfs(d + 1, 0, s_money);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  a.resize(n + 1);
  visited.resize(n + 1);
  for (int i = 0; i < n; i++) cin >> a[i + 1];
  dfs(1, 0, 1000);
  cout << (ans) << "\n";
  return 0;
}
