#include <bits/stdc++.h>
using ll = int64_t;
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  for (int i = 0; i < (n); ++i) cin >> p[i];
  vector<int> che;
  bool age = false;
  if (p[0] < p[1]) age = true;
  if (age) che.push_back(p[0]);
  for (int i = 0; i < (n - 1); ++i) {
    if (p[i] == p[i + 1]) continue;
    if (age) {
      if (p[i] > p[i + 1]) {
        age = false;
        che.push_back(p[i]);
      }
    } else {
      if (p[i] < p[i + 1]) {
        age = true;
        che.push_back(p[i]);
      }
    }
  }
  if (age) che.push_back(p[n - 1]);
  int m = che.size();
  m /= 2;
  ll ans = 1000;
  for (int i = 0; i < (m); ++i) {
    int cnt = (ans / che[i * 2]);
    ans -= (che[i * 2] * cnt);
    ans += (che[i * 2 + 1] * cnt);
  }
  cout << ans << endl;
  return 0;
}
