#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int p = 0, i = 0;
  int m = 1000;
  while (i <= n) {
    i++;
    for (int j = i; j <= n; ++j)
      if (a[j] - a[i] > p) {
        p = a[j] - a[i];
        int t = m / a[i];
        int d = m % a[i];
        m = t * a[j] + d;
        i = j;
        break;
      }
  }
  cout << m << endl;
}
