#include <bits/stdc++.h>
using namespace std;
int n = 22;
int m = 22;
double p[22][22];
double dp[300000][22];
double solve(int mask, int last, int vis) {
  if (vis == m) {
    if (last == 1) {
      dp[mask][last] = 1.0;
      return 1.0;
    }
    dp[mask][last] = 0.0;
    return 0.0;
  }
  if (dp[mask][last] != -1) {
    return dp[mask][last];
  }
  for (int i = 0; i < n; i++) {
    if ((mask & (1 << i)) == 0) {
      double res = solve((mask ^ (1 << (i))), last, vis + 1) * p[last][i + 1] +
                   solve((mask ^ (1 << (i))), i + 1, vis + 1) * p[i + 1][last];
      dp[mask][last] = max(dp[mask][last], res);
    }
  }
  return dp[mask][last];
}
double solve2(int mask, int last, int vis) {
  if (vis == m) {
    if (last == 1) return 1.0;
    return 0.0;
  }
  if (dp[mask][last] != -1) {
    return dp[mask][last];
  }
  for (int i = 0; i < n; i++) {
    if ((mask & (1 << i)) == 0) {
      double res = solve((mask ^ (1 << (i))), last, vis + 1) * p[last][i + 1] +
                   solve((mask ^ (1 << (i))), i + 1, vis + 1) * p[i + 1][last];
      dp[mask][last] += (1.0 / (n - vis)) * res;
    }
  }
  return dp[mask][last];
}
int main() {
  for (int i = 0; i < 300000; i++)
    for (int j = 0; j < 22; j++) dp[i][j] = -1.0;
  scanf(" %d", &n);
  m = n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      scanf(" %lf", &p[i][j]);
    }
  }
  for (int i = 0; i < n; i++) solve((0 ^ (1 << (i))), i + 1, 1);
  double mx = -1;
  for (int i = 0; i < n; i++) mx = max(dp[0 ^ (1 << (i))][i + 1], mx);
  printf("%.8f", mx);
  return 0;
}
