#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  vector<int> a;
  a.clear();
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
  int tmp = a[0];
  for (auto it = a.begin() + 1; it != a.end(); it++) {
    if (*it == tmp) {
      a.erase(it);
      it--;
    }
    tmp = *it;
  }
  int mon = 1000, cnt = 0;
  if (a[0] < a[1]) {
    cnt += mon / a[0];
    mon %= a[0];
  }
  int i = 1;
  for (; i < a.size() - 1; i++) {
    if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
      mon += a[i] * cnt;
      cnt = 0;
    } else if (a[i] < a[i + 1] && a[i] < a[i - 1]) {
      cnt += mon / a[i];
      mon %= a[i];
    }
  }
  if (a[i] > a[i - 1]) {
    mon += a[i] * cnt;
    cnt = 0;
  }
  cout << mon << endl;
  return 0;
}
