#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printVector(vector<T> vector) {
  if (vector.size() > 0) cout << vector[0];
  for (auto it = ++vector.begin(); it != vector.end(); it++) cout << " " << *it;
  cout << ";\n";
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, minima, maxima, i = 0, num_cotton_candy = 0, money = 1000;
  cin >> N;
  vector<int> prices(N);
  for (int i = 0; i < N; i++) {
    cin >> prices[i];
  }
  minima = maxima = prices[0];
  while (i < prices.size() - 1) {
    while (i < prices.size() - 1 && prices[i] >= prices[i + 1]) i++;
    minima = prices[i];
    while (i < prices.size() - 1 && prices[i] <= prices[i + 1]) i++;
    maxima = prices[i];
    num_cotton_candy = money / minima;
    money -= num_cotton_candy * minima;
    money += num_cotton_candy * maxima;
    num_cotton_candy = 0;
  }
  cout << money << "\n";
  return EXIT_SUCCESS;
}
