#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  map<string, long long> dp;
  dp["0"] = 1000;
  long long ans = 1000;
  for (int i = 0; i < (n); i++) {
    for (auto it = dp.begin(); it != dp.end(); it++) {
      long long kabu = stoi((*it).first);
      if (dp["0"] < (*it).second + kabu * a[i])
        dp["0"] = (*it).second + kabu * a[i];
      if (ans < dp["0"]) ans = dp["0"];
      long long cb = (*it).second / a[i];
      if (dp[to_string(kabu + cb)] < ((*it).second - cb * a[i]))
        dp[to_string(kabu + cb)] = ((*it).second - cb * a[i]);
    }
  }
  cout << ans << "\n";
  return 0;
}
