#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, m, n, t;
  cin >> n;
  int ar[n];
  m = 1000;
  for (i = 0; i < n; i++) cin >> ar[i];
  for (i = 1; i < n;) {
    vector<int> v;
    v.push_back(ar[i - 1]);
    if (ar[i] < ar[i - 1]) {
      i++;
      continue;
    }
    while (i < n and ar[i] >= ar[i - 1]) {
      v.push_back(ar[i]);
      i++;
    }
    if (v.size() > 0) {
      int x = m / v[0];
      m = m % v[0] + x * (v[v.size() - 1]);
    }
  }
  cout << m;
}
