#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int stock = 0, money = 1000, value, cnt = 0;
  vector<int> A(n + 1);
  for (int i = 0; i < (int)(n); i++) cin >> A[i];
  A[n] = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (A[0] >= A[i]) cnt++;
  }
  if (cnt == n) {
  }
  int start_pos = n;
  for (int i = 0; i < (int)(n); i++) {
    int current = A[i];
    for (int j = i + 1; j < n; j++) {
      if (current < A[j]) {
        start_pos = i;
        break;
      }
    }
    if (start_pos != n) break;
  }
  bool buy = false;
  if (start_pos != n) stock = money / A[start_pos];
  money -= stock * A[start_pos];
  value = A[start_pos];
  for (int i = start_pos; i < n; i++) {
    if (buy && i != n - 1) {
      while (A[i] > A[i + 1]) {
        i++;
      }
      stock = money / A[i];
      money -= stock * A[i];
      value = A[i];
      buy = false;
    } else {
      int ii = i;
      for (int j = ii + 1; j <= n; j++) {
        i++;
        if (value < A[j] && A[j] > A[j + 1]) {
          money += stock * A[j];
          stock = 0;
          break;
        }
      }
      buy = true;
    }
  }
  money += stock * A[n - 1];
  cout << money << endl;
  return 0;
}
