#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long long N = 5e5 + 5, inf = 1e9 + 5000;
long long add(long long x, long long y) {
  x += y;
  if (x >= MOD) return x - MOD;
  return x;
}
long long sub(long long x, long long y) {
  x -= y;
  if (x < 0) return x + MOD;
  return x;
}
long long mult(long long x, long long y) { return (x * y) % MOD; }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<int> b;
  b.push_back(inf);
  b.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) {
      b.push_back(a[i]);
    }
  }
  b.push_back(-inf);
  int stocks = 0;
  int money = 1000;
  for (int i = 1; i < b.size() - 1; i++) {
    if (b[i - 1] > b[i] && b[i] < b[i + 1]) {
      stocks += money / b[i];
      money %= b[i];
    } else if (b[i - 1] < b[i] && b[i] > b[i + 1]) {
      money += b[i] * stocks;
      stocks = 0;
    }
  }
  cout << money << endl;
  return 0;
}
