#include <bits/stdc++.h>
using namespace std;
const int maxn = 85;
int n;
int a[maxn];
void read_input() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
}
void solve() {
  int cur = 1000;
  int ans = cur;
  stack<pair<int, int> > stk;
  for (int i = 1; i <= n; ++i) {
    while (!stk.empty() && a[i] <= stk.top().first) {
      cur += stk.top().first * stk.top().second;
      stk.pop();
    }
    while (!stk.empty() && a[i] >= stk.top().first) {
      cur += a[i] * stk.top().second;
      stk.pop();
    }
    ans = max(ans, cur);
    stk.push(pair<int, int>(a[i], cur / a[i]));
    cur %= a[i];
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  read_input();
  solve();
}
