#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
template <typename T>
void DEBUG(string label, T value) {
  cerr << "[" << label << " = " << value << "]\n";
}
void solve() {
  int n;
  cin >> n;
  vector<int> cost(n);
  for (int i = 0; i < n; ++i) {
    cin >> cost[i];
  }
  int i = 0;
  vector<pair<int, int>> p;
  while (true) {
    while (i + 1 < n && cost[i] >= cost[i + 1]) {
      i++;
    }
    if (i + 1 >= n) {
      break;
    }
    int j = i + 1;
    while (j < n && cost[j] > cost[j - 1]) {
      j++;
    }
    p.push_back({cost[i], cost[j - 1]});
    i = j;
  }
  ll money = 1000;
  for (auto e : p) {
    int count_low = (money / e.first);
    money = money - ((money / e.first) * e.first);
    money = money + count_low * e.second;
  }
  cout << money << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
