#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T amax(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
vector<string> vec_splitter(string s) {
  for (char& c : s) c = c == ',' ? ' ' : c;
  stringstream ss;
  ss << s;
  vector<string> res;
  for (string z; ss >> z; res.push_back(z))
    ;
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) int idx,
               __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << "): ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
long long int power(long long int b, long long int e) {
  assert(e >= 0);
  if (e == 0) return 1;
  if (e % 2 == 1)
    return b * power(b * b, (e - 1) / 2);
  else
    return power(b * b, e / 2);
}
long long int power(long long int b, long long int e, long long int m) {
  assert(e >= 0);
  if (e == 0) return 1;
  if (e % 2 == 1)
    return b * power(((b % m) * (b % m)) % m, (e - 1) / 2, m) % m;
  else
    return power(((b % m) * (b % m)) % m, e / 2, m) % m;
}
const long double pi = acos(-1);
constexpr int mod = 1e9 + 7;
void swagWaalaFunction() {
  long long int n;
  cin >> n;
  long long int arr[n + 1], dp[100][2], last = -1, nextbig[n + 1],
                                        nextsmall[n + 1];
  for (long long int i = 0; i < (long long int)n; ++i) cin >> arr[i];
  memset(nextbig, -1, sizeof(nextbig));
  ;
  memset(nextsmall, -1, sizeof(nextsmall));
  ;
  for (long long int i = 0; i < (long long int)n; ++i) {
    if (i < n - 1) {
      for (long long int j = (long long int)i + 1;
           i + 1 < n ? j < (long long int)n : (long long int)n < j;
           i + 1 < n ? ++j : --j)
        if (arr[j] > arr[i]) {
          nextbig[i] = j;
          break;
        }
      for (long long int j = (long long int)i + 1;
           i + 1 < n ? j < (long long int)n : (long long int)n < j;
           i + 1 < n ? ++j : --j)
        if (arr[j] < arr[i]) {
          nextsmall[i] = j;
          break;
        }
    }
  }
  long long int money = 1000, stocks = 0;
  for (long long int i = 0; i < (long long int)n; ++i) {
    if (stocks and nextsmall[i] != -1 and nextbig[i] > nextsmall[i]) {
      money += stocks * arr[i];
      stocks = 0;
      last = i;
      continue;
    }
    if (nextbig[i] == -1 and stocks)
      money += stocks * arr[i];
    else if (nextbig[i] == -1)
      break;
    if (money / arr[i] and nextbig[i] != -1) {
      stocks += money / arr[i];
      money %= arr[i];
      last = i;
    }
  }
  cout << money << '\n';
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int tc = 1;
  for (long long int i = 0; i < (long long int)tc; ++i) {
    swagWaalaFunction();
  }
  return 0;
}
