#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> list;
  cin >> list.at(0);
  int number = 1;
  int count = 1;
  while (count < N) {
    int a;
    cin >> a;
    if (a != list.at(number - 1)) {
      list.at(number) = a;
      number++;
    }
    count++;
  }
  int money = 1000;
  int kabu = 0;
  int x = list.size();
  if (x == 1) {
    cout << money << endl;
  }
  if (x == 2) {
    if (list.at(0) < list.at(1)) {
      kabu = money / list.at(0);
      money = money - list.at(0) * kabu + list.at(1) * kabu;
    }
    cout << money << endl;
  }
  if (x > 2) {
    if (list.at(0) < list.at(1)) {
      kabu = money / list.at(0);
      money -= kabu * list.at(0);
    }
    for (int j = 1; j < x - 1; j++) {
      if (list.at(j) < list.at(j + 1) && list.at(j - 1) > list.at(j)) {
        kabu = money / list.at(j);
        money -= list.at(j) * kabu;
      }
      if (list.at(j) > list.at(j + 1) && list.at(j - 1) < list.at(j)) {
        money += list.at(j) * kabu;
        kabu = 0;
      }
    }
    money += list.at(x - 1) * kabu;
    cout << money << endl;
  }
}
