#include <bits/stdc++.h>
using namespace std;
int n, *x;
map<pair<long long, long long>, long long> *dp;
long long solve(int i = 0, long long sum = 1000, long long stock = 0) {
  if (i == n) return sum;
  if (dp[i].find({sum, stock}) != dp[i].end()) return dp[i][{sum, stock}];
  long long &ret = dp[i][{sum, stock}];
  ret = solve(i + 1, sum - sum / x[i] * x[i], stock + sum / x[i]);
  ret = max(ret, solve(i + 1, sum, stock));
  ret = max(ret, solve(i + 1, sum + stock * x[i], 0));
  return ret;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cin >> n;
  x = new int[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  dp = new map<pair<long long, long long>, long long>[n];
  cout << solve();
}
