#include <bits/stdc++.h>
using namespace std;
int find(int money, int stocks, int bors, int* a, int pos, int n) {
  if (pos == n) return money;
  if (bors == 0) {
    int ans1 = find(money, stocks, 0, a, pos + 1, n);
    int nstocks = stocks + money / a[pos];
    int nmoney = money % a[pos];
    int ans2 = find(nmoney, nstocks, 1, a, pos + 1, n);
    int ans = max(ans1, ans2);
    return ans;
  }
  if (bors == 1) {
    int ans1 = find(money, stocks, 1, a, pos + 1, n);
    int nstocks = 0;
    int nmoney = money + stocks * a[pos];
    int ans2 = find(nmoney, nstocks, 0, a, pos + 1, n);
    int ans = max(ans1, ans2);
    return ans;
  }
}
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = find(1000, 0, 0, a, 0, n);
  cout << ans << endl;
  return 0;
}
