#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
  vector<int> par;
  UnionFind(int n) : par(n, -1) {}
  void init(int n) { par.assign(n, -1); }
  int root(int x) {
    if (par[x] < 0)
      return x;
    else
      return par[x] = root(par[x]);
  }
  bool issame(int x, int y) { return root(x) == root(y); }
  bool merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (par[x] > par[y]) swap(x, y);
    par[x] += par[y];
    par[y] = x;
    return true;
  }
  int size(int x) { return -par[root(x)]; }
};
int gcd(int a, int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int(i) = 0; (i) < (n); ++(i)) cin >> a[i];
  vector<vector<pair<long long, long long>>> dp(
      n + 1, vector<pair<long long, long long>>(2));
  dp[0][0] = make_pair(0, 1000);
  for (int(i) = 0; (i) < (n); ++(i)) {
    dp[i + 1][0] = dp[i][0];
    if (dp[i + 1][0].second < dp[i][1].first * a[i] + dp[i][1].second) {
      dp[i + 1][0] = make_pair(0, dp[i][1].first * a[i] + dp[i][1].second);
    }
    dp[i + 1][1] = dp[i][1];
    if (dp[i + 1][1].first < dp[i][0].second / a[i]) {
      dp[i + 1][1] = make_pair(dp[i][0].second / a[i], dp[i][0].second % a[i]);
    }
  }
  cout << dp[n][0].second << endl;
}
