#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll x0 = 1000, y0 = 0, x1 = 0, y1 = 0;
  for (int i = 0; i < n; i++) {
    x1 += y1 * a[i];
    x1 = max(x0, x1);
    y1 = 0;
    y0 = x0 / a[i];
    x0 %= a[i];
    swap(x0, x1);
    swap(y0, y1);
  }
  cout << x0 << endl;
  return 0;
}
