#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uint = unsigned int;
const ll mod = (ll)1e9 + 7;
vector<int> a;
int n;
int ans = 0;
void dfs(int money, int stock, int it, bool up) {
  if (up) {
    while (it < n - 1 && a[it] <= a[it + 1]) it++;
    if (it == n - 1) {
      money += stock * a[it];
      ans = max(money, ans);
      return;
    }
    money += stock * a[it];
    stock = 0;
    dfs(money, stock, it, false);
  } else {
    while (it < n - 1 && a[it] >= a[it + 1]) it++;
    if (it == n - 1) {
      ans = max(ans, money);
      return;
    }
    int ds = money / a[it];
    stock += ds;
    money -= ds * a[it];
    dfs(money, stock, it, true);
  }
}
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  dfs(1000, 0, 0, false);
  cout << ans << endl;
  return 0;
}
