#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T, typename U>
ostream &operator<<(ostream &s, const pair<T, U> m) {
  cout << "(" << m.first << ", " << m.second << ")";
  return s;
}
template <typename T, typename U>
ostream &operator<<(ostream &s, const map<T, U> m) {
  ll c = 0;
  cout << "{ ";
  for (auto &(i) : (m)) cout << i << (c++ == m.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  cout << "{ ";
  for (ll(i) = 0LL; (i) < (ll)(v.size()); (i)++)
    cout << v[i] << (i == v.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const list<T> &v) {
  ll c = 0;
  cout << "{ ";
  for (auto &(i) : (v)) cout << i << (c++ == v.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
int main(void) {
  ll N;
  ll money = 1000;
  ll kabu = 0;
  cin >> N;
  vector<ll> A(N);
  for (ll(i) = 0LL; (i) < (ll)(N); (i)++) cin >> A[i];
  A.erase(unique(A.begin(), A.end()), A.end());
  for (ll(i) = 0LL; (i) < (ll)(A.size()); (i)++) {
    ll temp = i;
    ll temp2 = i;
    for (ll(j) = (ll)(i + 1); (j) < (ll)(N); (j)++) {
      if (A[i] > A[j])
        temp = j;
      else
        break;
    }
    for (ll(j) = (ll)(i + 1); (j) < (ll)(N); (j)++) {
      if (A[i] < A[j])
        temp2 = j;
      else
        break;
    }
    if (i == temp2) {
      money += A[i] * kabu;
      kabu = 0;
    } else if (i == temp) {
      ll temp = money / A[i];
      kabu += temp;
      money -= temp * A[i];
    }
  }
  cout << money << endl;
  return 0;
}
