#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A;
  int before = 0;
  A.push_back(1e9);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a != before) A.push_back(a);
    before = a;
  }
  A.push_back(0);
  int ans = 1000;
  int stock = 0;
  for (int i = 1; i < A.size() - 1; i++) {
    if (A[i - 1] > A[i] && A[i] < A[i + 1]) {
      stock = ans / A[i];
      ans = ans - stock * A[i];
    }
    if (A[i - 1] < A[i] && A[i] > A[i + 1]) {
      ans = ans + stock * A[i];
      stock = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
