#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  long long l = v.size();
  for (long long i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
int main() {
  int n;
  cin >> n;
  vector<double> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  double ans = v[n - 1];
  if (ans == 1) {
    printf("%0.12lf\n", ans);
    return 0;
  }
  double P = (1 - v[n - 1]);
  double S = v[n - 1] / P;
  for (int i = n - 2; i >= 0; i--) {
    double temp = ans + P * v[i] * (1 - S);
    if (temp < ans) {
      break;
    }
    ans = temp;
    P *= (1 - v[i]);
    S += v[i] / (1 - v[i]);
  }
  printf("%0.12lf\n", ans);
  return 0;
}
