#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  std::fill((T*)array, (T*)(array + N), val);
}
int main() {
  long long int n, now;
  cin >> n;
  vector<long long int> a(n), dp(100, 1000);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    now = dp[i] / a[i];
    for (int j = i + 1; j < n; j++) {
      if (a[i] >= a[j]) continue;
      dp[j + 1] = max(dp[j + 1], now * a[j] + (dp[i] % a[i]));
    }
  }
  cout << dp[n] << endl;
}
