#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n = 0;
  cin >> n;
  vector<long long> a(n);
  vector<long long> dp(n + 1);
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0] = 1000;
  for (int i = 0; i < n; i++) {
    int cur = dp[i] / a[i], left = dp[i] % a[i];
    for (int j = i + 1; j < n; j++) {
      dp[j] = max(dp[i], max(dp[j], cur * a[j] + left));
    }
  }
  cout << dp[n - 1];
  return 0;
}
