#include <bits/stdc++.h>
using namespace std;
const int Nmax = 2.7e5 + 17;
const int Tmax = 19;
double curr[Tmax][Nmax];
double g[Tmax][Tmax];
int n;
double solve(int mask, int i) {
  double& ans = curr[i][mask];
  if (ans > -0.5) return ans;
  if (mask == (1 << n) - 1) return ans = !i;
  ans = 0;
  for (int j = 0; j < n; j++)
    if (!(mask & (1 << j))) {
      double cur = 0;
      cur += solve(mask | (1 << j), i) * g[i][j];
      cur += solve(mask | (1 << j), j) * g[j][i];
      if (cur > ans) ans = cur;
    }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int z = 0; z < n; z++) cin >> g[i][z];
  int x = (1 << n) - 1;
  if (n == 1) {
    cout << 1;
    exit(0);
  } else {
    for (int i = 0; i < n; i++)
      for (int z = 0; z <= x; z++) curr[i][z] = -1;
    double ans = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < i; j++) {
        int mask = (1 << i) | (1 << j);
        double cur = 0;
        cur += solve(mask | (1 << j), i) * g[i][j];
        cur += solve(mask | (1 << j), j) * g[j][i];
        if (cur > ans) ans = cur;
      }
    printf("%.7Lf", ans);
  }
}
