#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n, 0);
  vector<int> fixed;
  fixed.reserve(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> a[i];
  }
  int point = a[0];
  fixed.push_back(a[0]);
  vector<int> stack;
  int way = -2;
  for (int i = 1; i < n; ++i) {
    if (way == -2) {
      if (point == a[i]) {
        way = 0;
      } else if (point < a[i]) {
        way = 1;
      } else {
        way = -1;
      }
      stack.push_back(a[i]);
      point = a[i];
    } else {
      if (way == 0) {
        if (point != a[i]) {
          stack.clear();
          stack.push_back(a[i]);
          if (point < a[i]) {
            way = 1;
          } else {
            way = -1;
          }
          point = a[i];
        }
      } else if (way == 1) {
        if (point < a[i]) {
          stack.clear();
          stack.push_back(a[i]);
        } else if (point > a[i]) {
          fixed.insert(fixed.end(), stack.begin(), stack.end());
          stack.clear();
          stack.push_back(a[i]);
          way = -1;
          point = a[i];
        }
      } else if (way == -1) {
        if (point > a[i]) {
          stack.clear();
          stack.push_back(a[i]);
        } else if (point < a[i]) {
          fixed.insert(fixed.end(), stack.begin(), stack.end());
          stack.clear();
          stack.push_back(a[i]);
          way = 1;
          point = a[i];
        }
      }
    }
  }
  if (stack.size() > 0 && way != 0) {
    fixed.insert(fixed.end(), stack.begin(), stack.end());
  }
  if (fixed.size() >= 2 && fixed[0] > fixed[1]) {
    fixed.erase(fixed.begin());
  }
  int money = 1000;
  int stock = 0;
  if (fixed.size() == 1) {
    cout << money << endl;
    return 0;
  }
  point = -1;
  int last = -1;
  for (int i = 0; i < (int)(fixed.size()); ++i) {
    if (point == -1) {
      point = fixed[i];
    } else {
      last = point;
      point = fixed[i];
      if (last < point) {
        stock = money / last;
        money -= last * stock;
      } else {
        money += stock * last;
        stock = 0;
      }
    }
  }
  if (stock > 0) {
    money += stock * point;
  }
  cout << money << endl;
  return 0;
}
