#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename type>
ostream &operator<<(ostream &out, const vector<type> &massive) {
  for (const type &i : massive) {
    out << i << ' ';
  }
  return out;
}
template <typename type>
void print(const vector<type> &massive, const string &sep, const string &end) {
  if (!massive.empty()) {
    cout << massive[0];
    for (int i = 1; i < massive.size(); ++i) {
      cout << sep << massive[i];
    }
  }
  cout << end;
}
template <typename type>
void print(const vector<type> &massive) {
  print(massive, " ", "\n");
}
template <typename type>
void print(const type &element, const string &end) {
  cout << element << end;
}
template <typename type>
void print(const type &element) {
  print(element, "\n");
}
int main() {
  fast();
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &i : a) {
    cin >> i;
  }
  int now_sum = 1000, stocks = 0, ans = now_sum;
  bool buying = true;
  for (int i = 0; i < n - 1; ++i) {
    if (buying) {
      if (a[i] < a[i + 1]) {
        buying = false;
        stocks += (now_sum / a[i]);
        now_sum -= (stocks * a[i]);
      }
    } else {
      if (a[i] > a[i + 1]) {
        buying = true;
        now_sum += (stocks * a[i]);
        stocks = 0;
      }
    }
    ans = max(ans, now_sum + stocks * a[i]);
  }
  if (!buying) {
    now_sum += (stocks * a[n - 1]);
    stocks = 0;
    ans = max(ans, now_sum);
  }
  print(ans);
  return 0;
}
