#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec;
  int input;
  cin >> input;
  vec.push_back(input);
  for (int i = 1; i < N; i++) {
    cin >> input;
    if (vec[vec.size() - 1] == input) {
      continue;
    } else {
      vec.push_back(input);
    }
  }
  int size = vec.size();
  long long money = 1000;
  int stock = 0;
  for (int i = 0; i < size - 1; i++) {
    if (vec[i + 1] > vec[i]) {
      while (money >= vec[i]) {
        money -= vec[i];
        stock++;
      }
      while (stock > 0) {
        money += vec[i + 1];
        stock--;
      }
    }
  }
  cout << money << endl;
}
