#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[1000];
  for (int i = 0; i < N; ++i) cin >> A[i];
  int B[1000];
  for (int i = 1; i < N - 1; ++i) {
    if (A[i] == A[i - 1] && A[i] == A[i + 1]) B[i] = 0;
    if (A[i - 1] > A[i] && A[i] > A[i + 1]) B[i] = 0;
    if (A[i - 1] < A[i] && A[i] < A[i + 1]) B[i] = 0;
    if (A[i - 1] >= A[i] && A[i] < A[i + 1]) B[i] = 1;
    if (A[i - 1] > A[i] && A[i] <= A[i + 1]) B[i] = 1;
    if (A[i - 1] <= A[i] && A[i] > A[i + 1]) B[i] = 2;
    if (A[i - 1] < A[i] && A[i] >= A[i + 1]) B[i] = 2;
  }
  if (A[0] < A[1])
    B[0] = 1;
  else
    B[0] = 0;
  if (A[N - 2] < A[N - 1])
    B[N - 1] = 2;
  else
    B[N - 1] = 0;
  int start = 1000;
  int kabu = 0;
  int sinkabu = 0;
  for (int i = 0; i < N - 1; ++i) {
    if (B[i] == 0) {
      kabu = kabu;
      start = start;
    } else if (B[i] == 1) {
      sinkabu = start / A[i];
      kabu = kabu + sinkabu;
      start = start - sinkabu * A[i];
    } else if (B[i] == 2) {
      start = start + kabu * A[i];
      kabu = 0;
    }
  }
  start = start + kabu * A[N - 1];
  cout << start << endl;
}
