#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj_list;
vector<bool> visited;
string decimal_to_binary(long long n) {
  if (n < 0) {
    n = 256 + n;
  }
  string result = "";
  while (n > 0) {
    result = string(1, (char)(n % 2 + 48)) + result;
    n = n / 2;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int x;
  if (a[0] < 1000) x = 1000 / a[0];
  cout << x * a[n - 1];
}
