#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[N];
  bool up;
  cin >> A[0] >> A[1];
  int ii = 2;
  for (int(i) = (2); (i) < (N); (i++)) {
    bool up = A[ii - 1] > A[ii - 2];
    cin >> A[ii];
    if (up && A[ii] > A[ii - 1])
      A[ii - 1] = A[ii];
    else if (!up && A[ii] < A[ii - 1])
      A[ii - 1] = A[ii];
    else if (A[ii] == A[ii - 1])
      continue;
    else
      ii++;
  }
  N = ii;
  int money = 1000, stock = 0;
  for (int(i) = (0); (i) < (N - 1); (i++)) {
    if (A[i] < A[i + 1]) {
      stock += money / A[i];
      money %= A[i];
    } else {
      money += stock * A[i];
      stock = 0;
    }
  }
  money += stock * A[N - 1];
  cout << money << endl;
  return 0;
}
