#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  bool m[n], M[n];
  for (long long i = 0; i < n; ++i) {
    m[i] = false;
    M[i] = false;
  }
  for (long long i = 0; i < n; ++i) {
    if (i == 0) {
      if (a[i] < a[i + 1]) m[i] = true;
    } else if (i == n - 1) {
      if (a[i - 1] < a[i]) M[i] = true;
    } else {
      if (a[i - 1] > a[i] && a[i] <= a[i + 1]) m[i] = true;
      if (a[i - 1] < a[i] && a[i] >= a[i + 1]) M[i] = true;
    }
  }
  long long x = 1000, c = 0, ans = 1000;
  for (long long i = 0; i < n; ++i) {
    if (m[i]) {
      c = x / a[i];
      x %= a[i];
    }
    if (M[i]) {
      x += a[i] * c;
      c = 0;
    }
    ans = max(x, ans);
  }
  cout << ans;
}
