#include <bits/stdc++.h>
using namespace std;
const int N = 2000006;
long long a[N];
pair<long long, long long> p[N];
long long v[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  p[0] = {0, 0};
  v[0] = 1000;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    for (int j = 0; j < i; j++) {
      long long nm = v[j] / a[i];
      long long rm = v[j] % a[i];
      if (nm >= p[i].first) {
        p[i].first = nm;
        p[i].second = rm;
      }
      long long sm = p[j].first * a[i] + p[j].second;
      v[i] = max(v[i], sm);
    }
  }
  long long ans = 1000;
  for (int i = 0; i <= n; i++) {
    ans = max(ans, v[i]);
    ans = max(ans, p[i].first * a[i] + p[i].second);
  }
  cout << ans;
  return 0;
}
