#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1, tc;
  for (tc = 1; tc <= t; tc++) {
    long long n, k, i, j, s = 1000, f, m, c;
    cin >> n;
    long long a[n + 5];
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n - 1;) {
      f = 0;
      m = a[i];
      j = i + 1;
      while (j < n) {
        if (a[j] > m) {
          f = 1;
          c = 0;
          while (s - m >= 0) {
            s -= m;
            c++;
          }
          while (c--) {
            s += a[j];
          }
          break;
        }
        m = min(a[j], m);
        j++;
      }
      if (f == 0) break;
      i = j + 1;
    }
    cout << s;
  }
  return 0;
}
