#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vll a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<pair<long long, long long> > kabu(n + 1);
  vector<pair<long long, long long> > kane(n + 1);
  kabu[0] = make_pair(1000, 0);
  kane[0] = make_pair(1000, 0);
  for (int i = 0; i < n; ++i) {
    if (kabu[i].second + kabu[i].first / a[i] >
        kane[i].second + kane[i].first / a[i]) {
      kabu[i + 1].second = kabu[i].second + kabu[i].first / a[i];
      kabu[i + 1].first = kabu[i].first % a[i];
    } else {
      kabu[i + 1].second = kane[i].second + kane[i].first / a[i];
      kabu[i + 1].first = kane[i].first % a[i];
    }
    if (kabu[i].first + kabu[i].second * a[i] >
        kane[i].first + kane[i].second * a[i]) {
      kane[i + 1].second = 0;
      kane[i + 1].first = kabu[i].first + kabu[i].second * a[i];
    } else {
      kane[i + 1].second = 0;
      kane[i + 1].first = kane[i].first + kane[i].second * a[i];
    }
  }
  cout << kane[n].first << endl;
  return 0;
}
