#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N + 1, -1);
  for (int i = 0; i < N; i++) cin >> A[i];
  int ans = 1000, max = 0, t = 0;
  for (int i = 0; i < N - 1; i++) {
    if (A[i] < A[i + 1]) {
      max = A[i + 1];
      t = ans / A[i];
      ans = ans % A[i];
    }
    if (t != 0) {
      for (int j = i + 1; j < N; j++) {
        if (max < A[j]) {
          max = A[j];
        } else {
          ans += t * max;
          t = 0;
        }
      }
    }
  }
  cout << ans << endl;
}
