#include <bits/stdc++.h>
using namespace std;
const long long N = 90;
long long a[N];
long long n;
bool sell;
long long res;
void dfs(long long u, long long date, long long m, long long cnt) {
  if (u == n + 1) {
    res = max(res, m);
    return;
  }
  if (cnt == 0) {
    cnt = m / a[u];
    m -= cnt * a[u];
    dfs(u + 1, u, m, cnt);
  } else {
    if (a[u] > a[date]) {
      m += cnt * a[u];
      cnt = 0;
      dfs(u + 1, u, m, cnt);
    }
  }
  dfs(u + 1, date, m, cnt);
}
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  res = 1000;
  dfs(1, -1, 1000, 0);
  cout << res << endl;
  return 0;
}
