#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  int aMin = a[0], aMax;
  int ans = 1000;
  for (int i = 0; i < (n); i++)
    if (a[i] > aMin) {
      aMax = a[i];
      while (i + 1 < n && a[++i] >= aMax) aMax = a[i];
      ans = max(ans % aMin + ans / aMin * aMax, ans);
      aMin = a[i];
    } else
      aMin = a[i];
  cout << ans << endl;
  return 0;
}
