#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class L, class R>
ostream& operator<<(ostream& os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.first << ":" << m.second << ") ";
  return os << "}";
}
const int MAX = 1000010;
const int MOD2 = 998244353;
const int MOD = 1000000007;
const int INF = 1e8;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const long double EPS = 1e-7;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& i : a) cin >> i;
  vector<int> red;
  int i = 0;
  while (i < n) {
    int j = i;
    red.push_back(a[i]);
    while (j < n and a[j] == a[i]) j++;
    i = j;
  }
  42;
  int s = red.size();
  int in = 1000;
  int st = 0;
  for (int i = 0; i < s; i++) {
    if (i != 0 and i != s - 1) {
      if (red[i - 1] > red[i] and red[i] < red[i + 1]) {
        st += (in / red[i]);
        in %= red[i];
      } else if (red[i - 1] < red[i] and red[i + 1] < red[i]) {
        in += (st * red[i]);
        st = 0;
      }
    } else if (i == 0) {
      if (red[i] < red[i + 1]) {
        st += (in / red[i]);
        in %= red[i];
      }
    } else if (i == s - 1) {
      in += (st * red[i]);
      st = 0;
    }
  }
  cout << in << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(25);
  cerr << fixed << setprecision(10);
  auto start = std::chrono::high_resolution_clock::now();
  solve();
  auto stop = std::chrono::high_resolution_clock::now();
  auto duration =
      std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
  return 0;
}
