#include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
int main() {
  const int INF = 1000000;
  int N;
  cin >> N;
  VI dp(N + 1);
  VI price(N + 1);
  dp[0] = 1000;
  price[0] = INF;
  for (int d = 1; d <= N; ++d) {
    cin >> price[d];
    for (int pd = 0; pd < d; ++pd) {
      dp[d] = max(dp[d], dp[pd]);
      int minP = INF;
      for (int i = pd; i < d; ++i) {
        minP = min(minP, price[i]);
      }
      int allIn = dp[pd] / minP;
      int remainder = dp[pd] % minP;
      dp[d] = max(dp[d], allIn * price[d] + remainder);
    }
  }
  cout << dp[N] << endl;
  return 0;
}
