#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int m = 1000, idx = 0;
  while (idx < n) {
    int small = a[idx];
    while (idx < n && a[idx] <= small) {
      small = a[idx];
      idx += 1;
    }
    if (idx < n) {
      int big = a[idx];
      while (idx < n && a[idx] >= big) {
        big = a[idx];
        idx += 1;
      }
      int x = m / small;
      m -= x * small;
      m += x * big;
    }
  }
  cout << m << '\n';
  return 0;
}
