#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000;
const long long INF2 = 1000000000000000000;
const long double pi = acos(-1);
const long long MOD = 1000000007;
long long my_pow(long long N, long long a, long long M) {
  long long tempo;
  if (a == 0) {
    return 1;
  } else {
    if (a % 2 == 0) {
      tempo = my_pow(N, a / 2, M);
      return (tempo * tempo) % M;
    } else {
      tempo = my_pow(N, a - 1, M);
      return (tempo * N) % M;
    }
  }
}
long long my_pow(long long N, long long a) {
  long long tempo;
  if (a == 0) {
    return 1;
  } else {
    if (a % 2 == 0) {
      tempo = my_pow(N, a / 2);
      return (tempo * tempo);
    } else {
      tempo = my_pow(N, a - 1);
      return (tempo * N);
    }
  }
}
long long my_combination(long long N, long long a, long long M) {
  if (N < a) return 0;
  long long answer = 1;
  for (long long i = 0; i < (a); i++) {
    answer *= (N - i);
    answer %= M;
  }
  for (long long i = 0; i < (a); i++) {
    answer *= my_pow(i + 1, M - 2, M);
    answer %= M;
  }
  return answer;
}
void my_combination_table(long long N, long long M, vector<long long>& v) {
  v.assign(N + 1, 1);
  for (long long i = 1; i <= N; i++) {
    v.at(i) = v.at(i - 1) * (N - (i - 1LL));
    v.at(i) %= M;
    v.at(i) *= my_pow(i, M - 2, M);
    v.at(i) %= M;
  }
}
void my_combination_table2(long long N, long long M, vector<long long>& v) {
  v.at(0) = 1;
  for (long long i = 1; i < (long long)v.size(); i++) {
    v.at(i) = v.at(i - 1) * (N + i);
    v.at(i) %= M;
    v.at(i) *= my_pow(i, M - 2, M);
    v.at(i) %= M;
  }
}
long long factorial(long long x, vector<long long>& dp) {
  if ((long long)dp.size() <= x) {
    long long n = dp.size();
    for (long long i = 0; i < (x + 1 - n); i++) {
      dp.push_back(0);
    }
  }
  if (x == 0) return dp.at(x) = 1;
  if (dp.at(x) != -1 && dp.at(x) != 0) return dp.at(x);
  return dp.at(x) = x * factorial(x - 1, dp);
}
long long factorial2(long long x, long long M, vector<long long>& dp) {
  if ((long long)dp.size() <= x) {
    long long n = dp.size();
    for (long long i = 0; i < (x + 1 - n); i++) {
      dp.push_back(0);
    }
  }
  if (x == 0) return dp.at(x) = 1;
  if (dp.at(x) != -1 && dp.at(x) != 0) return dp.at(x);
  return dp.at(x) = (x * factorial2(x - 1, M, dp)) % M;
}
long long factorial_inverse(long long x, long long M, vector<long long>& dp) {
  if ((long long)dp.size() <= x) {
    long long n = dp.size();
    for (long long i = 0; i < (x + 1 - n); i++) {
      dp.push_back(0);
    }
  }
  if (x == 0) return dp.at(x) = 1;
  if (dp.at(x) != -1 && dp.at(x) != 0) return dp.at(x);
  return dp.at(x) = (my_pow(x, M - 2, M) * factorial_inverse(x - 1, M, dp)) % M;
}
long long my_combination2(long long N, long long a, long long M,
                          vector<long long>& dp_factorial,
                          vector<long long>& dp_factorial_inverse) {
  if ((long long)dp_factorial.size() <= N) {
    factorial2(N, M, dp_factorial);
  }
  if ((long long)dp_factorial_inverse.size() <= N) {
    factorial_inverse(N, M, dp_factorial_inverse);
  }
  if (N < a) return 0;
  long long answer = 1;
  answer *= dp_factorial.at(N);
  answer %= M;
  answer *= dp_factorial_inverse.at(N - a);
  answer %= M;
  answer *= dp_factorial_inverse.at(a);
  answer %= M;
  return answer;
}
long long my_gcd(long long a, long long b) {
  if (b == 0) return a;
  return my_gcd(b, a % b);
}
long long my_gcd_extended(long long a, long long b, long long& x,
                          long long& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long tempo = my_gcd_extended(b, a % b, y, x);
  y -= (a / b) * x;
  return tempo;
}
void ll_to_vector(signed base, long long n, vector<signed>& v) {
  long long tempo = n;
  long long tempo2 = n;
  signed n_digit = 1;
  while (tempo2 >= base) {
    tempo2 /= base;
    n_digit++;
  }
  v.assign(n_digit, 0);
  for (signed i = 0; i < n_digit; i++) {
    long long denominator = my_pow(base, n_digit - 1 - i);
    v.at(i) = tempo / denominator;
    tempo -= v.at(i) * denominator;
  }
}
long long char_to_int(char c) {
  switch (c) {
    case '0':
      return 0;
    case '1':
      return 1;
    case '2':
      return 2;
    case '3':
      return 3;
    case '4':
      return 4;
    case '5':
      return 5;
    case '6':
      return 6;
    case '7':
      return 7;
    case '8':
      return 8;
    case '9':
      return 9;
    default:
      return 0;
  }
}
void prime_judge(vector<bool>& prime_or_not) {
  prime_or_not.assign(prime_or_not.size(), true);
  prime_or_not.at(0) = false;
  prime_or_not.at(1) = false;
  long long n = prime_or_not.size() - 1;
  for (long long i = 2; 2 * i <= n; i++) {
    prime_or_not.at(2 * i) = false;
  }
  for (long long i = 3; i * i <= n; i += 2) {
    if (prime_or_not.at(i)) {
      long long j = i * i;
      while (j < n + 1) {
        prime_or_not.at(j) = false;
        j += 2 * i;
      }
    }
  }
};
vector<long long> sieve(long long n) {
  n++;
  vector<long long> res(n, 0);
  for (long long i = 1; i < n; i++) {
    if (i % 2 == 0)
      res.at(i) = 2;
    else
      res.at(i) = i;
  }
  for (long long i = 3; i * i < n; i += 2) {
    if (res.at(i) == i) {
      long long j = i * i;
      while (j < n) {
        if (res.at(j) == j) res.at(j) = i;
        j += 2 * i;
      }
    }
  }
  return res;
};
bool is_prime(long long N) {
  if (N == 1 || N == 0) return false;
  if (N == 2 || N == 3) return true;
  if (N % 2 == 0) return false;
  if (N % 3 == 0) return false;
  for (long long i = 1; (6 * i + 1) * (6 * i + 1) <= N; ++i) {
    if (N % (6 * i + 1) == 0) return false;
  }
  for (long long i = 0; (6 * i + 5) * (6 * i + 5) <= N; ++i) {
    if (N % (6 * i + 5) == 0) return false;
  }
  return true;
}
map<long long, long long> divide_to_prime(long long target) {
  map<long long, long long> res;
  long long upper_lim = ceil(pow((long double)(target), 0.50));
  vector<bool> prime_or_not(upper_lim + 3, true);
  if (upper_lim < 20) prime_or_not.assign(25, true);
  prime_or_not.at(0) = false;
  prime_or_not.at(1) = false;
  prime_judge(prime_or_not);
  long long tempo = target;
  for (long long i = 1; i * i <= target; i++) {
    if (prime_or_not.at(i)) {
      while (tempo % i == 0) {
        tempo /= i;
        res[i]++;
      }
    }
    if (tempo == 1) break;
  }
  if (tempo != 1) res[tempo]++;
  return res;
}
map<long long, long long> divide_to_prime2(long long target,
                                           vector<long long>& min_factor) {
  map<long long, long long> res;
  if (min_factor.empty() || (long long)min_factor.size() - 1 < target)
    min_factor = sieve(target);
  while (target > 1) {
    res[min_factor[target]]++;
    target /= min_factor[target];
  }
  return res;
}
vector<long long> count_dividers(long long target) {
  vector<long long> dividers, tempo;
  long long i = 1;
  while (i * i < target + 1) {
    if (target % i == 0) {
      dividers.push_back(i);
      if (i < target / i) tempo.push_back(target / i);
    }
    i++;
  }
  for (long long j = 0; j < (long long)tempo.size(); j++) {
    dividers.push_back(tempo.at(tempo.size() - 1 - j));
  }
  return dividers;
}
vector<long long> count_dividers2(long long target,
                                  vector<long long>& min_factor) {
  vector<long long> dividers = {1};
  map<long long, long long> memo = divide_to_prime2(target, min_factor);
  for (auto&& iter = memo.begin(); iter != memo.end(); iter++) {
    vector<long long> tempo = dividers;
    for (long long k = 0; k < (long long)tempo.size(); k++) {
      long long times = 1;
      for (long long j = 1; j <= (iter->second); j++) {
        times *= iter->first;
        dividers.push_back(tempo[k] * times);
      }
    }
  }
  sort(dividers.begin(), dividers.end());
  return dividers;
}
void BFS_labyrinth(queue<pair<long long, long long>>& que,
                   vector<vector<long long>>& dist, long long& area) {
  long long n = dist.size();
  long long m = dist.at(0).size();
  while (!que.empty()) {
    long long h, w;
    pair<long long, long long> tempo = que.front();
    que.pop();
    h = tempo.first;
    w = tempo.second;
    for (long long dh = -1; dh <= 1; dh++) {
      for (long long dw = -1; dw <= 1; dw++) {
        if (h + dh < 0 || n <= h + dh) continue;
        if (w + dw < 0 || m <= w + dw) continue;
        if (dh == 0 && dw == 0) continue;
        if (dh * dw != 0) continue;
        if (dist.at(h + dh).at(w + dw) != -1) continue;
        dist.at(h + dh).at(w + dw) = dist.at(h).at(w) + 1;
        que.push(make_pair(h + dh, w + dw));
      }
    }
    if (que.empty()) {
      for (long long i = 0; i < (n); i++) {
        for (long long j = 0; j < (m); j++) {
          if (dist.at(i).at(j) == -1) {
            que.push(make_pair(i, j));
            dist.at(i).at(j) = 0;
            area++;
            break;
          }
        }
        if (!que.empty()) break;
      }
    }
  }
}
void BFS01_labyrinth(deque<pair<long long, long long>>& que,
                     vector<vector<long long>>& dist,
                     vector<vector<long long>>& cost) {
  long long n = dist.size();
  long long m = dist.at(0).size();
  while (!que.empty()) {
    long long h, w;
    pair<long long, long long> tempo = que.front();
    que.pop_front();
    h = tempo.first;
    w = tempo.second;
    for (long long dh = -1; dh <= 1; dh++) {
      for (long long dw = -1; dw <= 1; dw++) {
        if (h + dh < 0 || n <= h + dh) continue;
        if (w + dw < 0 || m <= w + dw) continue;
        if (dh == 0 && dw == 0) continue;
        if (dh * dw != 0) continue;
        if (dist.at(h + dh).at(w + dw) != -1) continue;
        dist.at(h + dh).at(w + dw) =
            dist.at(h).at(w) + cost.at(h + dh).at(w + dw);
        if (cost.at(h + dh).at(w + dw) == 0) {
          que.push_front(make_pair(h + dh, w + dw));
        } else {
          que.push_back(make_pair(h + dh, w + dw));
        }
      }
    }
  }
}
void dfs(const vector<vector<long long>>& G, vector<bool>& seen, long long v) {
  seen.at(v) = true;
  for (long long next_v : G.at(v)) {
    if (seen.at(next_v)) continue;
    dfs(G, seen, next_v);
  }
}
class edge {
 public:
  long long to;
  long long cost;
};
void dijkstra(long long s, const vector<vector<edge>> G,
              vector<long long>& dist) {
  long long V = dist.size();
  dist.assign(V, INF);
  priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
                 greater<pair<long long, long long>>>
      que;
  dist.at(s) = 0;
  que.push(make_pair(0, s));
  while (!que.empty()) {
    pair<long long, long long> p = que.top();
    que.pop();
    long long v = p.second;
    if (dist.at(v) < p.first) continue;
    for (long long i = 0; i < (long long)G.at(v).size(); i++) {
      edge e = G.at(v).at(i);
      if (dist.at(e.to) > dist.at(v) + e.cost) {
        dist.at(e.to) = dist.at(v) + e.cost;
        que.push(make_pair(dist.at(e.to), e.to));
      }
    }
  }
}
const long long Vmax2 = 1;
long long dp_warshall[Vmax2][Vmax2];
void warshall_floyd(long long V, const vector<vector<long long>> G) {
  for (long long i = 0; i < (V); i++) {
    for (long long j = 0; j < (V); j++) {
      dp_warshall[i][j] = G.at(i).at(j);
    }
  }
  for (long long k = 0; k < (V); k++) {
    for (long long i = 0; i < (V); i++) {
      for (long long j = 0; j < (V); j++) {
        dp_warshall[i][j] =
            min(dp_warshall[i][j], dp_warshall[i][k] + dp_warshall[k][j]);
      }
    }
  }
}
class UnionFind {
 public:
  vector<long long> parent;
  vector<long long> rank;
  UnionFind(long long N) : parent(N), rank(N, 0) {
    for (long long i = 0; i < (N); i++) {
      parent.at(i) = i;
    }
  }
  long long root(long long x) {
    if (parent.at(x) == x) return x;
    return parent.at(x) = root(parent.at(x));
  }
  void unite(long long x, long long y) {
    long long rx = root(x);
    long long ry = root(y);
    if (rx == ry) return;
    if (rank.at(rx) < rank.at(ry)) {
      parent.at(rx) = ry;
    } else {
      parent.at(ry) = rx;
      if (rank.at(rx) == rank.at(ry)) rank.at(rx)++;
    }
  }
  bool same(long long x, long long y) { return (root(x) == root(y)); }
  long long count_tree() {
    long long N = parent.size();
    long long res = 0;
    for (long long i = 0; i < (N); i++) {
      if (root(i) == i) res++;
    }
    return res;
  }
};
class wUnionFind {
 public:
  vector<long long> parent;
  vector<long long> diff_weight;
  vector<long long> rank;
  wUnionFind(long long N) : parent(N), diff_weight(N, 0), rank(N, 0) {
    for (long long i = 0; i < (N); i++) {
      parent.at(i) = i;
    }
  }
  long long root(long long x) {
    if (parent.at(x) == x) return x;
    long long r = root(parent.at(x));
    diff_weight.at(x) += diff_weight.at(parent.at(x));
    return parent.at(x) = r;
  }
  long long weight(long long x) {
    root(x);
    return diff_weight.at(x);
  }
  bool unite(long long x, long long y, long long w) {
    long long rx = root(x);
    long long ry = root(y);
    long long diff_weight_to_ry_from_rx = w + weight(x) - weight(y);
    if (rx == ry) return false;
    if (rank.at(rx) < rank.at(ry)) {
      parent.at(rx) = ry;
      diff_weight.at(rx) = -diff_weight_to_ry_from_rx;
    } else {
      parent.at(ry) = rx;
      diff_weight.at(ry) = diff_weight_to_ry_from_rx;
      if (rank.at(rx) == rank.at(ry)) rank.at(rx)++;
    }
    return true;
  }
  bool same(long long x, long long y) { return (root(x) == root(y)); }
  long long count_tree() {
    long long N = parent.size();
    long long res = 0;
    for (long long i = 0; i < (N); i++) {
      if (root(i) == i) res++;
    }
    return res;
  }
};
class SegmentTree {
 private:
  long long ini = INF;

 public:
  long long Size;
  vector<long long> node;
  SegmentTree(long long N) : Size(N), node(N) {
    long long new_N = 1;
    while (new_N < N) new_N *= 2;
    node.assign(2 * new_N - 1, ini);
    Size = new_N;
  }
  SegmentTree(vector<long long> v) : Size(v.size()), node(v.size()) {
    long long new_N = 1;
    while (new_N < (long long)v.size()) new_N *= 2;
    node.assign(2 * new_N - 1, ini);
    Size = new_N;
    for (long long i = 0; i < (long long)v.size(); i++)
      node.at(Size - 1 + i) = v.at(i);
    for (long long i = Size - 2; i >= 0; i--)
      node.at(i) = min(node.at(2 * i + 1), node.at(2 * i + 2));
  }
  void update(long long k, long long x) {
    k += Size - 1;
    node.at(k) = x;
    while (k > 0) {
      k = (k - 1) / 2;
      node.at(k) = min(node.at(k * 2 + 1), node.at(k * 2 + 2));
    }
  }
  long long query(long long a, long long b, long long k, long long l,
                  long long r) {
    if (r <= a || b <= l) return ini;
    if (a <= l && r <= b)
      return node.at(k);
    else {
      long long vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
      long long vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
      return min(vl, vr);
    }
  }
};
long long my_merge(vector<long long>& A, vector<long long>& B, long long left,
                   long long mid, long long right,
                   function<bool(long long, long long)> comp) {
  long long i = left;
  long long j = mid;
  long long k = 0;
  long long res = 0;
  while (i < mid && j < right) {
    if (comp(A.at(i), A.at(j)))
      B.at(k++) = A.at(i++);
    else {
      B.at(k++) = A.at(j++);
      res += mid - i;
    }
  }
  if (i == mid) {
    while (j < right) {
      B.at(k++) = A.at(j++);
    }
  } else {
    while (i < mid) {
      B.at(k++) = A.at(i++);
    }
  }
  for (long long l = 0; l < (k); l++) {
    A.at(left + l) = B.at(l);
  }
  return res;
}
long long my_merge_sort(vector<long long>& target, vector<long long>& tempo,
                        long long left, long long right,
                        function<bool(long long, long long)> comp) {
  long long mid, res = 0;
  if (left == right || left == right - 1) return res;
  mid = (left + right) / 2;
  res += my_merge_sort(target, tempo, left, mid, comp);
  res += my_merge_sort(target, tempo, mid, right, comp);
  res += my_merge(target, tempo, left, mid, right, comp);
  return res;
}
long long my_merge_sort(vector<long long>& target, vector<long long>& tempo,
                        long long left, long long right) {
  return my_merge_sort(target, tempo, left, right, less_equal<long long>());
}
template <typename T>
class mat {
 public:
  vector<vector<T>> m;
  mat() : m(vector<vector<T>>()){};
  mat(long long h, long long w) : m(vector<vector<T>>(h, vector<T>(w))){};
  mat(long long h, long long w, T ini)
      : m(vector<vector<T>>(h, vector<T>(w, ini))){};
  long long H = m.size();
  long long W = m.at(0).size();
  void show() {
    for (long long i = 0; i < H; i++) {
      for (long long j = 0; j < W; j++) {
        cout << m.at(i).at(j) << " ";
      }
      cout << endl;
    }
  }
  vector<T> operator[](const long long i) const { return m[i]; }
  vector<T>& operator[](const long long i) { return m[i]; }
  vector<T> at(const long long i) const { return m.at(i); }
  vector<T>& at(const long long i) { return m.at(i); }
  mat& operator=(const mat& a) { return *a; }
  mat& operator+=(const mat& a) {
    assert(W == a.W && H == a.H);
    for (long long i = 0; i < (H); i++)
      for (long long j = 0; j < (W); j++) m[i][j] += a[i][j];
    return *this;
  }
  mat& operator-=(const mat& a) {
    assert(W == a.W && H == a.H);
    for (long long i = 0; i < (H); i++)
      for (long long j = 0; j < (W); j++) m[i][j] -= a[i][j];
    return *this;
  }
  mat& operator*=(const mat& a) {
    assert(W == a.H);
    mat<T> m2(H, a.W, 0);
    for (long long i = 0; i < (H); i++) {
      for (long long j = 0; j < (a.W); j++) {
        for (long long k = 0; k < (W); k++) {
          m2[i][j] += m[i][k] * a[k][j];
          m2[i][j] %= MOD;
        }
      }
    }
    W = a.W;
    for (long long i = 0; i < (H); i++) m[i].resize(W);
    for (long long i = 0; i < (H); i++) {
      for (long long j = 0; j < (W); j++) {
        m[i][j] = m2[i][j];
      }
    }
    return *this;
  }
  mat operator+(const mat& a) const { return mat(*this) += a; }
  mat operator-(const mat& a) const { return mat(*this) -= a; }
  mat operator*(const mat& a) const { return mat(*this) *= a; }
  bool operator==(const mat& a) {
    assert(W == a.W && H == a.H);
    bool flg = true;
    for (long long i = 0; i < (H); i++) {
      for (long long j = 0; j < (W); j++) {
        if (m[i][j] != a[i][j]) {
          flg = false;
          return flg;
        }
      }
    }
    return flg;
  }
  mat& operator+=(const T& a) {
    for (long long i = 0; i < (H); i++)
      for (long long j = 0; j < (W); j++) m[i][j] += a;
    return *this;
  }
  mat& operator-=(const T& a) {
    for (long long i = 0; i < (H); i++)
      for (long long j = 0; j < (W); j++) m[i][j] -= a;
    return *this;
  }
  mat& operator*=(const T& a) {
    for (long long i = 0; i < (H); i++)
      for (long long j = 0; j < (W); j++) m[i][j] *= a;
    return *this;
  }
  mat& operator/=(const T& a) {
    for (long long i = 0; i < (H); i++)
      for (long long j = 0; j < (W); j++) m[i][j] /= a;
    return *this;
  }
  mat operator+(const T& a) const { return mat(*this) += a; }
  mat operator-(const T& a) const { return mat(*this) -= a; }
  mat operator*(const T& a) const { return mat(*this) *= a; }
  mat operator/(const T& a) const { return mat(*this) /= a; }
  mat mat_pow(long long n) {
    assert(W == H);
    if (n == 0) {
      mat temp(H, W, (T)0);
      for (long long i = 0; i < (H); i++) {
        temp[i][i] = (T)1;
      }
      return temp;
    }
    if (n % 2 == 0) {
      mat temp = mat_pow(n / 2);
      return temp * temp;
    } else {
      mat temp = mat_pow(n - 1);
      temp *= mat(*this);
      return temp;
    }
  }
};
long double calc_dist(long long x1, long long x2, long long y1, long long y2) {
  long long tempo = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  long double res = pow((long double)((long double)tempo), 0.50);
  return res;
}
long long doubling(vector<vector<long long>> next, long long v, long long N) {
  vector<signed> memo;
  ll_to_vector(2, N, memo);
  long long M = 0;
  M = next.size();
  long long now = v;
  for (long long i = 0; i < M; i++) {
    if (N & (long long)(1LL << i)) {
      now = next.at(i).at(now);
    }
  }
  return now;
}
signed main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (long long i = 0; i < (N); i++) cin >> A.at(i);
  vector<long long> memo(N, 0);
  for (long long i = 0; i < (N); i++) {
    if (i == 0) {
      if (A.at(i + 1) > A.at(i))
        memo.at(i) = 1;
      else if (A.at(i + 1) < A.at(i))
        memo.at(i) = -1;
    } else if (i == N - 1) {
      if (A.at(i - 1) <= A.at(i)) memo.at(i) = -1;
    } else {
      if (A.at(i - 1) <= A.at(i) && A.at(i) > A.at(i + 1))
        memo.at(i) = -1;
      else if (A.at(i - 1) >= A.at(i) && A.at(i) < A.at(i + 1))
        memo.at(i) = 1;
    }
  }
  long long res = 1000;
  long long kabu = 0;
  for (long long i = 0; i < (N); i++) {
    if (memo.at(i) == -1) {
      res += kabu * A.at(i);
      kabu = 0;
    } else if (memo.at(i) == 1) {
      kabu = res / A.at(i);
      res -= kabu * A.at(i);
    }
  }
  cout << res << endl;
  for (long long i = 0; i < (N); i++) {
  }
}
