#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long a[1000005], n;
long long dp[85][100005];
long long cal(long long x, long long y) {
  if (x > n) return y;
  long long &r = dp[x][y];
  if (r != -1) return r;
  r = cal(x + 1, y);
  long long p = y / a[x];
  for (long long i = x + 1; i <= y; i++) {
    if (a[i] <= a[x]) continue;
    long long q = (a[i] - a[x]) * p;
    long long r1 = cal(i, y + q);
    r = max(r, r1);
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long k, i, j, x, y, z;
  while (cin >> n) {
    for (i = 1; i <= n; i++) cin >> a[i];
    memset(dp, -1, sizeof(dp));
    long long ans = cal(1, 1000);
    cout << ans << endl;
  }
  return 0;
}
