#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int money = 1000;
  int mx = 0;
  int stock = 0;
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1]) {
      while (true) {
        if (money - a[i] >= 0) {
          money -= a[i];
          stock++;
        } else {
          break;
        }
      }
    }
    while (stock > 0) {
      money += a[i];
      stock--;
    }
    mx = max(mx, money);
  }
  while (stock > 0) {
    money += a[n - 1];
    stock--;
  }
  mx = max(mx, money);
  cout << mx << endl;
  return 0;
}
