#include <bits/stdc++.h>
using namespace std;
long long backtracking(long long money, long long stocks, int i, int n,
                       int a[]) {
  if (i >= n) {
    return money;
  }
  if (stocks == 0) {
    long long doNothing = backtracking(money, stocks, i + 1, n, a);
    long long buyStocks = backtracking(money - (money / a[i]) * a[i],
                                       stocks + money / a[i], i + 1, n, a);
    return max(doNothing, buyStocks);
  } else {
    long long sellStocks = backtracking(money + stocks * a[i], 0, i + 1, n, a);
    long long doNothing = backtracking(money, stocks, i + 1, n, a);
    return max(doNothing, sellStocks);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << backtracking(1000, 0, 0, n, a);
  return 0;
}
