#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T, typename U>
ostream &operator<<(ostream &s, const pair<T, U> m) {
  cout << "(" << m.first << ", " << m.second << ")";
  return s;
}
template <typename T, typename U>
ostream &operator<<(ostream &s, const map<T, U> m) {
  ll c = 0;
  cout << "{ ";
  for (auto &(i) : (m)) cout << i << (c++ == m.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  cout << "{ ";
  for (ll(i) = 0LL; (i) < (ll)(v.size()); (i)++)
    cout << v[i] << (i == v.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const list<T> &v) {
  ll c = 0;
  cout << "{ ";
  for (auto &(i) : (v)) cout << i << (c++ == v.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
ll N;
vector<ll> A;
ll maxi = 0;
void dfs(ll index, ll kabu, ll money) {
  if (index == N - 1) {
    maxi = max(maxi, money + A.back() * kabu);
    return;
  }
  {
    ll temp = money / A[index];
    dfs(index + 1, kabu + temp, money - temp * A[index]);
  }
  { dfs(index + 1, 0, money + A[index] * kabu); }
}
int main(void) {
  cin >> N;
  A.resize(N);
  for (ll(i) = 0LL; (i) < (ll)(N); (i)++) cin >> A[i];
  dfs(0, 0, 1000);
  cout << maxi << endl;
  return 0;
}
