#include <bits/stdc++.h>
using namespace std;
inline void print() { cout << endl; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
  cout << first << ' ';
  print(rest...);
}
int N;
vector<int> A;
int ans = 0;
void rec(int n, int money, int stock) {
  if (n == N - 1) {
    ans = max(ans, money);
    return;
  }
  int money_copy = money;
  int stock_copy = stock;
  int buy = money / A[n];
  money -= A[n] * buy;
  stock += buy;
  for (int i = n + 1; i < N; i++) {
    int sell = stock;
    money += A[i] * stock;
    stock = 0;
    rec(i, money, stock);
  }
}
void solve() {
  cin >> N;
  A.resize(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  rec(0, 1000, 0);
  cout << ans << '\n';
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
