#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (auto &i : a) {
    cin >> i;
  }
  int sum = 1000, l = 0, r = 1;
  while (r < n) {
    if (a[l] <= a[r]) {
      while (r + 1 < n && a[r + 1] >= a[r]) r++;
      cout << "a[l]-> " << a[l] << endl;
      int temp = sum / a[l];
      sum -= temp * a[l];
      sum += a[r] * temp;
      cout << (1300 % 11) << endl;
      cout << "sum-> " << sum << endl;
      l = r + 1, r = r + 1;
    } else {
      l++;
      r++;
    }
  }
  cout << sum << endl;
}
