#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
inline bool chmin(T& x, U y) {
  if (x > y) {
    x = y;
    return true;
  }
  return false;
}
template <class T, class U>
inline bool chmax(T& x, U y) {
  if (x < y) {
    x = y;
    return true;
  }
  return false;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n + 1, INT_MAX), b(n + 1, 1000);
  for (int i = 1; i <= (n); ++i) {
    cin >> a[i];
    b[i] = b[i - 1];
    for (int j = 0; j < (i); ++j) chmax(b[i], b[j] / a[j] * a[i] + b[j] % a[j]);
  }
  cout << b[n] << '\n';
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int t{1};
  for (int i = 0; i < (t); ++i) solve();
}
