#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  v.resize(unique(v.begin(), v.end()) - v.begin());
  n = v.size();
  string s(n, '.');
  s[0] = 'b';
  for (int i = 1; i < n; i++) {
    if (v[i] < v[i - 1]) {
      s[i] = 'b';
      if (s[i - 1] == 'b') s[i - 1] = '.';
    } else if (v[i] > v[i - 1]) {
      s[i] = 's';
      if (s[i - 1] == 's') s[i - 1] = '.';
    }
  }
  42;
  42;
  vector<int> stock = {0, 0, 1000};
  for (int i = 0; i < n; i++) {
    int cur = stock[0] * stock[1] + stock[2];
    if (s[i] == 'b') {
      stock[0] = cur / v[i];
      stock[1] = v[i];
      stock[2] = cur % v[i];
    } else if (s[i] == 's') {
      stock[2] += stock[0] * v[i];
      stock[0] = 0;
      stock[1] = 0;
    }
  }
  int cur = stock[0] * stock[1] + stock[2];
  cout << cur << endl;
}
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int testcase = 1;
  for (int i = 0; i < testcase; i++) {
    solve();
  }
  return 0;
}
