#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a(80);
int maxi = 0;
void solve(int day, int money, int stocks) {
  if (day == n + 1) {
    if (stocks != 0) money += a[n - 1] * stocks;
    maxi = max(money, maxi);
  } else {
    if (stocks == 0) {
      if (day != n && a[day - 1] >= a[day])
        solve(day + 1, money, stocks);
      else
        solve(day + 1, money - a[day - 1] * (money / a[day - 1]),
              stocks + money / a[day - 1]);
    } else {
      if (day != 1 && a[day - 1] > a[day - 2]) {
        if (day != n && a[day] > a[day - 1])
          solve(day + 1, money, stocks);
        else
          solve(day + 1, money + a[day - 1] * stocks, 0);
      } else if (day != n && a[day - 1] >= a[day])
        solve(day + 1, money, stocks);
      else
        solve(day + 1, money - a[day - 1] * (money / a[day - 1]),
              stocks + money / a[day - 1]);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  solve(1, 1000, 0);
  cout << maxi;
  return 0;
}
