#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int max1 = 1000;
  for (int i = 0; i < n - 1; i++) {
    int temp = 1000 / arr[i];
    for (int j = i + 1; j < n; j++) {
      max1 = max(temp * arr[j], max1);
    }
  }
  cout << max1 << endl;
}
