#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }
  vector<int> a(N);
  a.at(N - 1) = -1;
  for (int i = N - 1; i > 0; i--) {
    if (data.at(i - 1) > data.at(i))
      a.at(i - 1) = -1;
    else if (data.at(i - 1) < data.at(i))
      a.at(i - 1) = 1;
    else
      a.at(i - 1) = a.at(i);
  }
  int K = 0, M = 1000, Z = 0;
  for (int i = 0; i < N; i++) {
    if (a.at(i) == 1 && Z >= 0 && M >= data.at(i)) {
      K = M / data.at(i);
      M %= data.at(i);
      Z = -1;
    } else if (a.at(i) == -1 && Z < 0) {
      M += K * data.at(i);
      K = 0;
      Z = 1;
    }
  }
  cout << M << endl;
}
