#include <bits/stdc++.h>
int next_kai(int i, int N, std::vector<int> a) {
  if (i == N - 1) {
    return N - 1;
  } else if (a.at(i) <= a.at(i + 1)) {
    return i;
  } else if (a.at(i) > a.at(i + 1)) {
    return next_kai(i + 1, N, a);
  }
}
int next_uri(int i, int N, std::vector<int> a) {
  if (i == N - 1) {
    return N - 1;
  } else if (a.at(i) >= a.at(i + 1)) {
    return i;
  } else if (a.at(i) < a.at(i + 1)) {
    return next_uri(i + 1, N, a);
  }
}
int main() {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (int i = 0; i < N; i++) {
    std::cin >> a.at(i);
  }
  int kabu = 0, money = 1000;
  int i = 0;
  while (i < N) {
    int saiyasu_ind, saitaka_ind;
    saiyasu_ind = next_kai(i, N, a);
    saitaka_ind = next_uri(i, N, a);
    if (i == N - 1) {
      money = money + kabu * a.at(N - 1);
    }
    if (saiyasu_ind == i && saitaka_ind == i) {
      i++;
    } else if (saiyasu_ind == i) {
      kabu = kabu + money / a.at(i);
      money = money % a.at(i);
      i = saitaka_ind;
    } else if (saitaka_ind == i) {
      money = money + (kabu * a.at(i));
      kabu = 0;
      i = saiyasu_ind;
    }
  }
  std::cout << money << std::endl;
}
