#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  int N;
  cin >> N;
  int a[80];
  vector<int> v;
  vector<int> s;
  int key = a[0];
  int cand = 0;
  bool f = false;
  for (int i = 0; i < (int)(N); ++i) {
    cin >> a[i];
    if (i == 0)
      key = a[i];
    else {
      if (key <= a[i]) {
        f = true;
        key = a[i];
      } else {
        if (f) {
          v.push_back(cand);
          s.push_back(i - 1);
        }
        f = false;
        cand = i;
        key = a[i];
      }
    }
  }
  if (f) {
    v.push_back(cand);
    s.push_back(N - 1);
  }
  int now = 1000;
  int stk = 0;
  f = false;
  for (int i = 0; i < (int)(N); ++i) {
    if (s.size() != 0) {
      if (i == s[0]) {
        s.erase(s.begin());
        now += stk * a[i];
        stk = 0;
        f = false;
      }
    }
    if (v.size() != 0) {
      if (i == v[0]) {
        v.erase(v.begin());
        stk += now / a[i];
        now %= a[i];
        f = true;
      }
    }
  }
  cout << now << endl;
  return 0;
}
