#include <bits/stdc++.h>
const double eps = (1e-10);
using namespace std;
int dcmp(double a, double b) {
  return fabs(a - b) <= eps ? 0 : (a > b) ? 1 : -1;
}
int getBit(int num, int idx) { return ((num >> idx) & 1) == 1; }
int setBit1(int num, int idx) { return num | (1 << idx); }
int setBit0(int num, int idx) { return num & ~(1 << idx); }
int flipBit(int num, int idx) { return num ^ (1 << idx); }
int countNumBit1(int mask) {
  int ret = 0;
  while (mask) {
    mask &= (mask - 1);
    ++ret;
  }
  return ret;
}
int N;
vector<double> v;
int main() {
  cin >> N;
  double no;
  for (int i = 0; i < N; i++) {
    cin >> no;
    v.push_back(no);
  }
  double mx = 0.0;
  sort(((v).rbegin()), ((v).rend()));
  double p = 0.0, c = 1.0;
  for (int i = 0; i < N; i++) {
    p = p * (1 - v[i]) + v[i] * c;
    c *= (1 - v[i]);
    mx = max(mx, p);
  }
  cout << fixed << setprecision(10);
  cout << mx << endl;
}
