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