#include <bits/stdc++.h>
using namespace std;
int m = 1000, d;
deque<int> dq;
int maxM(int m, int s) {
  int maxR = m;
  for (int i = s + 1; i < d; i++) {
    if (dq[i] > dq[s]) {
      maxR = max(maxR, maxM(m + (m / dq[s]) * (dq[i] - dq[s]), i + 1));
    }
  }
  return maxR;
}
int main() {
  cin >> d;
  for (int i = 0; i < d; i++) {
    int inp;
    cin >> inp;
    if ((int)dq.size() <= 0 || inp != dq.back()) {
      dq.push_back(inp);
    }
  }
  int maxR = m;
  for (int i = 0; i < d; i++) {
    maxR = max(maxR, maxM(m, i));
  }
  cout << maxR << endl;
  return 0;
}
