#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0), ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto&& i : a) cin >> i;
  vector<pair<int, int>> v;
  int b = 0, s = 1;
  for (int i = 1; i < n; ++i) {
    if (a.at(i) < a.at(b)) b = i;
    if (a.at(i) >= a.at(s)) s = i;
    if (b < s && a.at(b) < a.at(s)) {
      v.push_back({a.at(b), a.at(s)});
      b = i, s = i;
    }
  }
  int64_t money = 1000;
  for (auto&& i : v) {
    int64_t stock = money / i.first;
    money -= 1L * stock * i.first;
    money += 1L * stock * i.second;
  }
}
