#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  long long A[N + 2], ans = 1000, stonk = 0;
  A[0] = 1000000000;
  A[N + 1] = 0;
  for (int i = 1; i <= N; ++i) scanf("%lld", &A[i]);
  for (int i = 1; i <= N; ++i) {
    if (A[i] > A[i - 1] && A[i] >= A[i + 1])
      ans += stonk * A[i], stonk = 0;
    else if (A[i] <= A[i + 1] && A[i] < A[i - 1])
      stonk += ans / A[i], ans %= A[i];
  }
  printf("%lld", ans);
  return 0;
}
