#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, m, n, p, s = 1000, t, a[200040];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (; i++ < n;) cin >> a[i];
  for (i = 1; i <= n;) {
    for (j = i; a[j] <= a[j + 1];) j++;
    if (j - i & 1) {
      for (k = i; k < j; k += 2) {
        m = s / a[k];
        s += m * (a[k + 1] - a[k]);
      }
    } else {
      for (p = s, k = i; k <= j; k++) {
        for (t = s, l = i;;) {
          if (l == k) l++;
          if (l > j) break;
          m = t / a[l++];
          t -= m * a[l];
          if (l == k) l++;
          t += m * a[l];
        }
        p = max(p, t);
      }
      s = max(s, p);
    }
    for (i = j; i <= n && a[i] > a[i + 1];) i++;
  }
  cout << s;
}
