#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  int money = 1000;
  int stock = 0;
  int before = A[0];
  int start = 0;
  while (A[start] == A[start + 1]) {
    if (start + 1 == N - 1) break;
    start++;
  }
  if (before < A[1]) {
    stock += money / A[0];
    money %= A[0];
  }
  for (int i = start + 1; i < N - 1; i++) {
    if (before < A[i] && A[i] > A[i + 1]) {
      money += stock * A[i];
      stock = 0;
    } else if (before > A[i] && A[i] < A[i + 1]) {
      stock += money / A[i];
      money %= A[i];
    }
    if (A[i] != A[i + 1]) before = A[i];
  }
  money += stock * A[N - 1];
  cout << money << endl;
}
