#include <bits/stdc++.h>
using namespace std;
int a[81], n;
long long solve(int l, int r, long long m) {
  long long ans = m;
  for (int i = l; i <= r; ++i) {
    for (int j = i + 1; j <= r; ++j) {
      if (a[i] < a[j] and (j == n - 1 or a[j] > a[j + 1])) {
        ans = max(ans, solve(j + 1, r, m + (m / a[i]) * (a[j] - a[i])));
      }
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << solve(0, n - 1, 1000);
  return 0;
}
