#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, money = 1000, stock = 0;
  cin >> n;
  vector<int> a(n, 0), dif(n + 1, -1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0) continue;
    dif[i] = a[i] - a[i - 1];
  }
  for (int i = 0; i < n; i++) {
    if (dif[i + 1] == 0)
      continue;
    else if (dif[i + 1] > 0) {
      while (money >= a[i]) {
        money -= a[i];
        stock++;
      }
    } else if (dif[i + 1] < 0) {
      while (stock > 0) {
        stock--;
        money += a[i];
      }
    }
  }
  cout << money << endl;
  return 0;
}
