#include <bits/stdc++.h>
using namespace std;
const int maxn = 19;
double dp[maxn][1 << maxn], g[maxn][maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) scanf("%lf", &g[i][j]);
  }
  int t = 1 << n;
  dp[0][t - 1] = 1;
  for (int i = t - 2; i; --i) {
    for (int j = 0; j < n; ++j) {
      if (!(i >> j & 1)) continue;
      for (int k = 0; k < n; ++k) {
        if (i >> k & 1) continue;
        int s = i | 1 << k;
        dp[j][i] = max(dp[j][i], g[j][k] * dp[j][s] + g[k][j] * dp[k][s]);
      }
    }
  }
  double ans = 0;
  for (int i = 0; i < n; ++i) ans = max(ans, dp[i][1 << i]);
  printf("%.10f\n", ans);
  return 0;
}
