#include <bits/stdc++.h>
using ll = long long;
const std::string yes = "Yes";
const std::string no = "No";
int main() {
  int n;
  std::cin >> n;
  std::vector<int> a(n);
  for (int i = 0; i < (n); i++) std::cin >> a[i];
  int last_n = n;
  for (int i = n - 1; i > -1; i--) {
    if (a[i - 1] >= a[i])
      last_n = i;
    else
      break;
  }
  n = last_n;
  ll kane = 1000, kabu = 0;
  for (int i = 0; i < n; i++) {
    if (i == n - 1) {
      kane += kabu * a[i];
    } else if (i == 0) {
      if (a[i] < a[i + 1]) {
        kabu = kane / a[i];
        kane = (kane % a[i] + a[i]) % a[i];
      }
    } else {
      if (a[i - 1] > a[i] && a[i] <= a[i + 1]) {
        kabu = kane / a[i];
        kane = (kane % a[i] + a[i]) % a[i];
      } else if (a[i - 1] < a[i] && a[i] >= a[i + 1]) {
        kane += kabu * a[i];
        kabu = 0;
      } else {
        continue;
      }
    }
  }
  std::cout << kane << "\n";
  return 0;
}
