#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
int main() {
  int n;
  int a[81];
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  int m = 1000, s = 0;
  for (int i = 0; i < (n - 1); i++) {
    if (a[i] < a[i + 1]) {
      while (m - a[i] >= 0) {
        m -= a[i];
        s++;
      }
      while (s - 1 >= 0) {
        m += a[i + 1];
        s--;
      }
    }
  }
  cout << m << endl;
}
