#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
double arr[123];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  double product, sum, ans;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  reverse(arr, arr + n);
  ans = sum = arr[0];
  product = (1 - arr[0]);
  sum /= (1 - arr[0]);
  for (int i = 1; i < n; i++) {
    product *= (1 - arr[i]);
    sum += (arr[i]) / (1 - arr[i]);
    ans = max(ans, product * sum);
  }
  cout << fixed << setprecision(9) << ans << endl;
  return 0;
}
