#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N), B;
  for (int i = 0; i < (int)(N); i++) {
    cin >> A[i];
  }
  int prev = -1;
  for (int i = 0; i < N; i++) {
    if (A[i] == prev)
      continue;
    else
      B.push_back(A[i]);
    prev = A[i];
  }
  prev = B[0];
  int judge = 0, cabu = 0, ans = 1000, last_sell = -1;
  for (int i = 1; i < B.size(); i++) {
    if (!judge && prev > B[i]) {
      prev = B[i];
      continue;
    } else if (!judge && prev < B[i]) {
      cabu = ans / prev;
      ans = ans % prev;
      last_sell = prev;
      judge = 1;
    } else if (judge && prev < B[i]) {
      prev = B[i];
      continue;
    } else if (judge && prev > B[i]) {
      ans += prev * cabu;
      last_sell = -1;
      judge = 0;
    }
    prev = B[i];
  }
  if (last_sell != -1) {
    ans += max(B.back() * cabu, last_sell * cabu);
  }
  cout << ans << endl;
}
