#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m = 1000, k = 0;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (a.at(i) < a.at(j)) {
        int l = a.at(i);
        for (int h = i; h <= j; h++) {
          l = min(a.at(h), l);
        }
        k += m / l;
        m -= k * l;
        m += k * a.at(j);
        k = 0;
        i = j;
        break;
      }
    }
  }
  cout << m << endl;
  return 0;
}
