#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int i, j, k, n, s;
  cin >> n;
  vector<int> a(n);
  for (i = 0; i < (n); ++i) cin >> a[i];
  k = 1000;
  if (a[0] < a[1]) {
    s = k / a[0];
    k = k % a[0];
  }
  for (i = 1; i <= (n - 2); ++i) {
    if (a[i] >= a[i + 1] && a[i] >= a[i - 1]) {
      k += s * a[i];
      s = 0;
    }
    if (a[i] <= a[i + 1] && a[i] <= a[i - 1]) {
      s += k / a[i];
      k = k % a[i];
    }
  }
  if (a[n - 1] > a[n - 2]) k += s * a[n - 1];
  cout << k << endl;
  return 0;
}
