#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long int binomial(long long int n, long long int k) {
  long long int C[k + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long int i = 1; i <= n; i++) {
    for (int j = min(i, k); j > 0; j--) C[j] = C[j] + C[j - 1];
  }
  return C[k];
}
vector<int> pr;
bool prime[10000000];
void Sieve(long long int n) {
  memset(prime, true, sizeof(prime));
  prime[1] = false;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      pr.push_back(p);
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
pair<int, int> fib(int n) {
  if (n == 0) return {0, 1};
  auto p = fib(n >> 1);
  int c = p.first * (2 * p.second - p.first);
  int d = p.first * p.first + p.second * p.second;
  if (n & 1)
    return {d, c + d};
  else
    return {c, d};
}
int sum(int n) {
  if (n == 0) return 0;
  return (n % 10 + sum(n / 10));
}
long long int factorial(long long int n, long long int m) {
  long long int fact = 1;
  for (int i = 2; i <= n; i++) {
    fact = (fact * i) % m;
  }
  return fact % m;
}
void reverse(string& str) {
  int n = str.length();
  for (int i = 0; i < n / 2; i++) swap(str[i], str[n - i - 1]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> v;
  v.push_back(a[0]);
  long long int m = a[0];
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) v.push_back(a[i]);
    m = max(m, a[i]);
  }
  long long int l = 1000;
  int p = 0;
  int o = 0;
  int r = 0;
  int s = 0;
  for (int i = 0; i < v.size(); i++) {
    if (p == 0) {
      o = 0;
      for (int j = i + 1; j < v.size(); j++) {
        if (v[j] > v[i]) {
          o = 1;
          break;
        }
      }
      if (o == 1) {
        int u = l / v[i];
        l -= u * v[i];
        s += u;
        o = 0;
        p = 1;
      } else
        break;
    } else {
      if (v[i] == m) {
        l += s * v[i];
        s = 0;
        break;
      } else {
        o = 0;
        r = 0;
        for (int j = i + 1; j < v.size(); j++) {
          if (v[j] > v[i]) {
            o = 1;
          }
          if (v[j] < v[i]) {
            r = 1;
          }
        }
        if (o == 1 && r == 1) {
          l += s * v[i];
          s = 0;
          o = 1;
          r = 0;
          p = 0;
        } else {
          break;
        }
      }
    }
  }
  cout << l << endl;
}
