#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int64_t> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int res = 0, cur = 1000, x = 0;
  for (int i = 0; i < N - 1; i++) {
    if (i + 1 < N && A[i] < A[i + 1]) {
      int c = cur / A[i];
      cur -= c * A[i];
      x += c;
    } else if (A[i] > A[i + 1]) {
      cur += x * A[i];
      x = 0;
    }
    res = max(res, cur);
  }
  if (x > 0) {
    cur += x * A[N - 1];
    x = 0;
  }
  res = max(res, cur);
  cout << res << '\n';
  return 0;
}
