#include <bits/stdc++.h>
using namespace std;
int main() {
  int money = 1000;
  int n;
  cin >> n;
  int a[n];
  double sum = 0;
  double ave = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  ave = sum / n;
  bool check = true;
  int kab = 0;
  int in = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == in) {
      continue;
    }
    if (ave > a[i] && check == true && i != n - 1) {
      check = false;
      kab = money / a[i];
      money = money % a[i];
      in = a[i];
    }
    if (ave < a[i] && check == false && i != 0) {
      check = true;
      money = kab * a[i] + money;
      in = a[i];
    }
  }
  if (check == false) {
    cout << 1000 << endl;
  } else {
    cout << money << endl;
  }
}
