#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, k = 1000;
  cin >> n;
  long long int a[n], i;
  for (long int index = 0; index < n; index++) cin >> a[index];
  ;
  long long int f = 0, max = 0, j = n, v, mx = 0;
  for (i = 1; i < n; i++) {
    if (a[i] > a[i - 1]) {
      i--;
      j = i;
      break;
    }
  }
  for (i = j; i < n - 1; i++) {
    if (f == 0) {
      f = 1;
      max = k / a[i];
      k = k % a[i];
      v = a[i];
      f = 1;
    } else if (f == 1 && a[i] >= v && a[i] > a[i + 1]) {
      k += max * a[i];
      f = 0;
    }
    if (k > mx) mx = k;
  }
  if (a[n - 1] > v && f == 1) {
    k += max * a[n - 1];
  }
  if (k > mx) mx = k;
  cout << mx << endl;
  return 0;
}
