#include <bits/stdc++.h>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template <class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto &&i : v) scanf("%d", &i);
  vector<int> ans(n, 1000);
  for (int i = 0; i < n; ++i) {
    if (i) ans[i] = max(ans[i], ans[i - 1]);
    for (int j = 0; j < i; ++j) {
      ans[i] = max(ans[i], ans[j] % v[j] + ans[j] / v[j] * v[i]);
    }
  }
  cout << *max_element(ans.begin(), ans.end()) << "\n";
  return 0;
}
