#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, a[200], dap = 1000, stock = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    if ((a[i] >= a[i - 1]) && (a[i] > a[i + 1])) {
      while (stock) {
        stock--;
        dap += a[i];
      }
    } else if ((a[i] <= a[i - 1]) && (a[i] < a[i + 1])) {
      while (dap >= a[i]) {
        stock++;
        dap -= a[i];
      }
    } else if ((i == 1) && (a[i] < a[i + 1])) {
      while (dap >= a[i]) {
        stock++;
        dap -= a[i];
      }
    } else if ((i == n)) {
      while (stock) {
        stock--;
        dap += a[i];
      }
    }
  }
  cout << dap;
  return 0;
}
