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