#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int32_t> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  map<int, int64_t> dp[n + 1];
  dp[0][0] = 1000;
  for (int i = 0; i < n; ++i) {
    for (auto item : dp[i]) {
      int64_t kabu = item.first;
      int64_t money = item.second;
      dp[i + 1][kabu + money / a[i]] = money - money / a[i] * a[i];
      dp[i + 1][0] = max(dp[i + 1][0], money + kabu * a[i]);
      dp[i + 1][kabu] = max(dp[i + 1][kabu], money);
    }
  }
  int64_t ans = 0;
  for (auto item : dp[n]) {
    ans = max(ans, item.second);
  }
  cout << ans << "\n";
  return 0;
}
