#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long N = 82;
unordered_map<long long, long long> mp[N];
long long go(long long pos, long long coins, vector<long long> &arr) {
  long long ret = 0, n = (long long)arr.size(), i, j;
  if (coins == 0 or pos >= n) {
    return 0;
  }
  if (mp[pos].find({coins}) != mp[pos].end()) {
    return mp[pos][coins];
  }
  long long tempbuy = coins / arr[pos];
  for (i = pos; i < n; i++) {
    if (arr[i] > arr[pos]) {
      long long temp = tempbuy * (arr[i] - arr[pos]);
      long long temp2 = go(i, coins + temp, arr);
      temp += temp2;
      ret = max(ret, temp);
    }
  }
  ret = max(ret, go(pos + 1, coins, arr));
  mp[pos][coins] = ret;
  return ret;
}
void solve() {
  long long n, i, j;
  cin >> n;
  vector<long long> arr(n), ans(n, 0);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  cout << 1000 + go(0, 1000, arr);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long T = 1;
  while (T--) {
    solve();
  }
}
