#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];
  }
  vector<vector<pair<int, int>>> dp(N, vector<pair<int, int>>(2));
  dp[0][0] = {0, 1000};
  dp[0][1] = {1000 / A[0], 1000 % A[0]};
  for (int i = 1; i < N; ++i) {
    pair<int, int> tmp, tmp2;
    tmp = {0, dp[i - 1][1].first * A[i] + dp[i - 1][1].second};
    dp[i][0] = max(dp[i - 1][0], tmp);
    tmp = {dp[i - 1][0].second / A[i], dp[i - 1][0].second % A[i]};
    tmp2 = {dp[i - 1][1].first + dp[i - 1][1].second / A[i],
            dp[i - 1][1].second % A[i]};
    dp[i][1] = max(tmp, tmp2);
  }
  cout << dp[N - 1][0].second << endl;
  return 0;
}
