#include <bits/stdc++.h>
using namespace std;
bool paircom(pair<int, int> pair<int, int>, pair<int, int> q) {
  return pair<int, int>.second < q.second;
}
void count(vector<int> v, vector<int>& ans) {
  sort(v.begin(), v.end());
  int n = v.size();
  int k = 1;
  int i = 1;
  bool bl = true;
  while (true) {
    while (bl) {
      if (v[i - 1] == v[i]) {
        k++;
      } else {
        bl = false;
      }
      i++;
    }
    ans.push_back(k);
    if (i >= (n - 1)) break;
    k = 1;
    bl = true;
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> c(n);
  vector<int> a;
  vector<int> d;
  vector<int> e;
  int b;
  for (int i = 0; i < n; i++) {
    cin >> b;
    c[i] = b;
    if (i == 0) {
      a.push_back(b);
    } else if (!(c[i - 1] == c[i])) {
      a.push_back(b);
    }
  }
  for (unsigned int i = 0; i < a.size() - 1; i++) {
    if (a[i] < a[i + 1]) {
      d.push_back(1);
    } else {
      d.push_back(0);
    }
  }
  e.push_back(a[0]);
  for (unsigned int i = 0; i < d.size() - 1; i++) {
    if (!(d[i] == d[i + 1])) {
      e.push_back(a[i + 1]);
    }
  }
  if (d[d.size() - 1] == 1) e.push_back(a[a.size() - 1]);
  int ans = 1000;
  int kabu = 0;
  int ko = 0;
  for (unsigned int i = 0; i < e.size(); i++) {
    if (i == e.size() - 1) {
      ans = ans + kabu * e[i];
      kabu = 0;
    } else {
      if (d[i] == 1) {
        ko = ans / e[i];
        ans = ans - ko * e[i];
        kabu = kabu + ko;
      }
      if (d[i] == 0) {
        ans = ans + kabu * e[i];
        kabu = 0;
      }
    }
    ko = 0;
  }
  cout << ans;
}
