#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int A[n + 1];
  A[0] = 0;
  for (int i = 1; i <= n; i++) cin >> A[i];
  if (n == 2) {
    if (A[1] < A[2]) {
      int ans = (1000 / A[1]) * A[2] + 1000 % A[1];
      cout << ans << endl;
      return 0;
    }
  }
  int chart[n + 1];
  chart[0] = 0;
  for (int i = 1; i < n; i++) {
    if (A[i] < A[i + 1])
      chart[i] = 1;
    else if (A[i] > A[i + 1])
      chart[i] = -1;
    else
      chart[i] = chart[i - 1];
  }
  int stock = 0;
  int money = 1000;
  for (int i = 1; i < n; i++) {
    if (chart[i - 1] < chart[i]) {
      stock = money / A[i];
      money %= A[i];
    } else if (chart[i - 1] > chart[i]) {
      money += A[i] * stock;
      stock = 0;
    }
  }
  if (stock > 0) money += stock * A[n];
  cout << money << endl;
  return 0;
}
