#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int x, long long int y) {
  return y ? gcd(y, x % y) : x;
}
long long int lcm(long long int x, long long int y) {
  return x / gcd(x, y) * y;
}
vector<pair<long long int, int>> factorize(long long int n) {
  vector<pair<long long int, int>> res;
  for (long long int i = 2; i * i <= n; ++i) {
    if (n % i) continue;
    res.emplace_back(i, 0);
    while (n % i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n, 1);
  return res;
}
long long int mod = 998244353;
int main() {
  int n;
  cin >> n;
  int a[n + 2];
  for (int i = 0; i < n + 1; i++) {
    cin >> a[i + 1];
  }
  a[n + 1] = 0;
  int money = 1000;
  int hatu = a[1];
  int kabu = 0;
  if (a[1] < a[2]) {
    while (money >= a[1]) {
      kabu++;
      money -= a[1];
    }
  }
  for (int i = 2; i < n + 1; i++) {
    int today = a[0];
    if (a[i] < a[i + 1] && a[i - 1] >= a[i] && money >= a[i]) {
      while (money >= a[i]) {
        kabu++;
        money -= a[i];
      }
    }
    if (a[i] > a[i + 1] && a[i - 1] <= a[i] && kabu > 0) {
      money += a[i] * kabu;
      kabu = 0;
    }
  }
  cout << money;
}
