#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int money = 1000;
  int stock = 0;
  for (int i = 0; i < n; i++) {
    if (i == n - 1) {
      while (true) {
        if (0 < stock) {
          money += a[i];
          stock--;
        }
        if (stock == 0) break;
      }
    } else {
      if (a[i] < a[i + 1]) {
        while (true) {
          if (0 <= money - a[i]) {
            money -= a[i];
            stock++;
          } else
            break;
        }
      } else if (a[i] == a[i + 1])
        continue;
      else {
        while (true) {
          if (0 < stock) {
            money += a[i];
            stock--;
          }
          if (stock == 0) break;
        }
      }
    }
  }
  cout << money << endl;
}
