#include <bits/stdc++.h>
using namespace std;
template <class T>
bool INRANGE(T x, T a, T b) {
  return a <= x && x <= 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 N;
vector<int> a;
int dfs(int day, int money, int stock) {
  if (day == N) return 1000;
  int val = -1;
  int afford = money / a[day];
  int buy =
      dfs(day + 1, money - (a[day] * afford), stock + afford) - a[day] * afford;
  int sell = dfs(day + 1, money + stock * a[day], 0) + stock * a[day];
  return max(buy, sell);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  a.resize(N);
  for (int i = 0; i < (N); ++i) cin >> a[i];
  cout << dfs(0, 1000, 0) << endl;
  return 0;
}
