#include <bits/stdc++.h>
using ll = long long;
const ll MOD = 1000000007;
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto& a : A) cin >> a;
  vector<int> mins, maxs;
  if (A[0] <= A[1]) mins.push_back(0);
  {
    int mini = 0, minv = A[0], maxi = 0, maxv = A[0];
    for (int i = 1; i < N - 1; ++i) {
      if (A[i - 1] >= A[i]) {
        minv = A[i];
        mini = i;
        if (A[i] < A[i + 1]) {
          mins.push_back(i);
        }
      }
      if (A[i - 1] <= A[i]) {
        maxv = A[i];
        maxi = i;
        if (A[i] > A[i + 1]) {
          maxs.push_back(i);
        }
      }
    }
  }
  if (A[N - 2] <= A[N - 1]) maxs.push_back(N - 1);
  {
    int m = 1000, k = 0, maxi = 0, mini = 0;
    for (int i = 0; i < N; ++i) {
      if (i == N - 1) {
        m += k * A[i];
        k = 0;
      } else if (mini < mins.size() && i == mins[mini]) {
        int t = m / A[i];
        m -= t * A[i];
        k += t;
        ++mini;
      } else if (maxi < maxs.size() && i == maxs[maxi]) {
        m += k * A[i];
        k = 0;
        ++maxi;
      }
    }
    cout << m << endl;
  }
  return 0;
}
