#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  bool p = true;
  int c = 1000, s = 0;
  for (int i = 0; i < n; i++) {
    if (i == n - 1) {
      if (p != true) c += s * a.at(i);
      break;
    }
    if (p) {
      if (a.at(i) < a.at(i + 1)) {
        s += c / a.at(i);
        c = c % a.at(i);
        p = false;
      } else
        continue;
    } else {
      if (a.at(i) > a.at(i + 1)) {
        c = c + s * a.at(i);
        s = 0;
        p = true;
      } else
        continue;
    }
  }
  cout << c;
  return 0;
}
