#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A;
  int a;
  cin >> a;
  int pred = a;
  A.push_back(a);
  for (int i = 1; i < N; i++) {
    cin >> a;
    if (pred != a) A.push_back(a);
    pred = a;
  }
  if (A.size() == 1) {
    cout << 1000 << endl;
    return 0;
  } else {
    vector<int> K;
    K.push_back(A[0]);
    for (int i = 1; i < (int)A.size() - 1; i++) {
      if (A[i - 1] < A[i] && A[i] > A[i + 1]) K.push_back(A[i]);
      if (A[i - 1] > A[i] && A[i] < A[i + 1]) K.push_back(A[i]);
    }
    K.push_back(A[A.size() - 1]);
    if (K[0] < K[1]) {
      long long money = 1000;
      for (int i = 1; i < (int)K.size(); i += 2) {
        money = money % A[i - 1] + (money / A[i - 1]) * A[i];
      }
      cout << money << endl;
    } else {
      long long money = 1000;
      for (int i = 2; i < (int)K.size(); i += 2) {
        money = money % A[i - 1] + (money / A[i - 1]) * A[i];
      }
      cout << money << endl;
    }
  }
}
