#include <bits/stdc++.h>
void purchace(long long* money, long long* kabu, int value) {
  *kabu += (int)(*money / value);
  *money -= *kabu * value;
  return;
}
void sell(long long* money, long long* kabu, int value) {
  *money += *kabu * value;
  *kabu = 0;
  return;
}
int main() {
  int N;
  std::cin >> N;
  std::vector<int> A(N);
  for (int i = 0; i < N; i++) std::cin >> A[i];
  std::vector<int> wave(N);
  int max = 0;
  int max_idx = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] > max) {
      max = A[i];
      max_idx = i;
    }
  }
  if (max <= A[0]) {
    std::cout << 1000 << std::endl;
    return 0;
  }
  long long money = 1000;
  long long kabu = 0;
  for (int i = 0; i <= max_idx; i++) {
    if (i == 0) {
      purchace(&money, &kabu, A[i]);
      continue;
    }
    if (A[i] < A[i - 1]) {
      if ((i != max_idx) && (A[i + 1] < A[i])) {
        continue;
      }
      purchace(&money, &kabu, A[i]);
    } else if (A[i] > A[i - 1]) {
      if ((i != max_idx) && (A[i + 1] > A[i])) {
        continue;
      }
      sell(&money, &kabu, A[i]);
    } else {
    }
  }
  std::cout << money << std::endl;
  return 0;
}
