#include <bits/stdc++.h>
using namespace std;
const long double EPS = 10e-9;
const int INF = 1e9 + 5;
const long long INFLL = (long long)INF * (long long)INF;
const long long MOD = 1e9 + 7;
const long double PI = 3.14159265358979323846;
struct HASH {
  size_t operator()(const pair<int, int>& x) const {
    return hash<long long>()(((long long)x.first) ^
                             (((long long)x.second) << 32));
  }
};
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = 0; i < (int)v.size(); ++i) {
    os << v[i];
    if (i != (int)v.size() - 1) os << ", ";
  }
  os << "]\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  os << "{";
  for (const auto& it : v) {
    os << it;
    if (it != *v.rbegin()) os << ", ";
  }
  os << "}\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const unordered_set<T>& v) {
  os << "{";
  for (const auto& it : v) {
    os << it;
    if (it != *v.rbegin()) os << ", ";
  }
  os << "}\n";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  os << "{";
  for (const auto& it : v) {
    os << it.first << " : " << it.second;
    if (it != *v.rbegin()) os << ", ";
  }
  os << "}\n";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const unordered_map<T, S>& v) {
  os << "{";
  for (const auto& it : v) {
    os << it.first << " : " << it.second;
    if (it != *v.rbegin()) os << ", ";
  }
  os << "}\n";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << "(";
  os << v.first << ", " << v.second << ")";
  os << "\n";
  return os;
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
struct Offset {
  set<long long> s;
  long long delta;
  long long getMinimum() { return (*s.begin()) + delta; }
  long long getMaximum() { return (*s.rbegin()) + delta; }
  void increase(long long x) { delta += x; }
  void add(long long x) { s.insert(x - delta); }
  void remove(long long x) { s.erase(x - delta); }
  bool contains(long long x) { return s.count(x - delta) != 0; }
};
const int N = 85;
int a[N];
void rec(int money, int day, int stocks, int& answer, int n) {
  if (day == n) {
    answer = max(answer, money + stocks * a[n]);
    return;
  }
  int can_buy = money / a[day];
  if (day == 1) {
    for (int i = 1; i <= can_buy; i++) {
      rec(money - i * a[1], day + 1, i, answer, n);
    }
  } else {
    for (int i = 0; i <= can_buy; i++) {
      for (int j = 0; j <= stocks; j++) {
        int new_m = money - a[day] * i + a[day] * j;
        answer = max(answer, new_m);
        rec(new_m, day + 1, stocks - j + i, answer, n);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int answer = 0;
  int money = 1000;
  int best = a[1];
  int prev = a[1];
  for (int i = 2; i <= n; i++) {
    if (a[i] > best) {
      best = a[i];
      int to_sell = money / prev;
      answer = money % prev;
      money -= to_sell * prev;
      answer += to_sell * best;
      money = answer;
      prev = best;
    }
    if (a[i] < prev) {
      prev = a[i];
    }
  }
  cout << answer << "\n";
  return 0;
}
