#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> a, b;
  cin >> n;
  int M = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    M = max(x, M);
    a.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    int x = a[i];
    if (i == 0)
      b.push_back(x);
    else if (i > 0 && a[i] != a[i - 1])
      b.push_back(x);
    if (a[i] == M) break;
  }
  int now = 1000, kabu = 0;
  vector<int> d, c(n);
  for (int i = 1; i < b.size(); i++) {
    if (b[i] - b[i - 1] > 0)
      c[i - 1] = 1;
    else
      c[i - 1] = -1;
  }
  d.push_back(b[0]);
  for (int i = 1; i < c.size(); i++) {
    if (c[i - 1] != c[i]) d.push_back(b[i]);
  }
  for (int i = 0; i < d.size(); i++) {
    if (d[i + 1] - d[i] > 0 && d[i] <= now) {
      kabu += (now - now % d[i]) / d[i];
      now -= kabu * d[i];
    }
    if (d[i + 1] - d[i] < 0) {
      now += kabu * d[i];
      kabu = 0;
    }
  }
  cout << now << endl;
  return 0;
}
