#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const int INF = 1e9 + 23;
const long long INFL = 2e18 + 23;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<long long> b;
  for (long long i = 0; i < n; i++) {
    b.push_back(a[i]);
    while (i < n and a[i] == b.back()) i++;
    i--;
  }
  cout << "b: ";
  for (long long x : b) cout << x << " ";
  cout << "\n";
  long long m = 1000;
  long long has = 0;
  for (long long i = 0; i < b.size(); i++) {
    if (i + 1 < b.size() and b[i] < b[i + 1]) {
      long long x = m / b[i];
      m -= x * b[i];
      has += x;
    } else {
      m += has * b[i];
      has = 0;
    }
  }
  cout << m;
  return 0;
}
