#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A;
  int count = 0;
  for (int n = 0; n < N; ++n) {
    int num = 0;
    cin >> num;
    if (0 == n) {
      A.push_back(num);
      count++;
    } else {
      if (A[count - 1] != num) {
        A.push_back(num);
        count++;
      }
    }
  }
  int now = 1000;
  int num = 0;
  int num2 = 0;
  int size = A.size();
  {
    if (A[0] < A[1]) {
      num = now / A[0];
      now -= A[0] * (num);
      num2 = A[0];
    }
  }
  for (int n = 1; n < size - 1; ++n) {
    if (A[n] > A[n - 1] && A[n] > A[n + 1]) {
      now += A[n] * num;
      num = 0;
      num2 = A[n];
    }
    if (A[n] < A[n - 1] && A[n] < A[n + 1]) {
      num = now / A[n];
      now -= A[n] * num;
      num2 = A[n];
    }
  }
  { now += max(A[size - 1], num2) * num; }
  cout << now << endl;
  return 0;
}
