#include <bits/stdc++.h>
using namespace std;
double dp[1 << 20][20], p[20][20];
bool mark[1 << 20][20];
int n;
double mem(int mask, int winner) {
  if (!mask) return (winner == 1);
  if (mark[mask][winner]) return dp[mask][winner];
  mark[mask][winner] = true;
  double &ret = dp[mask][winner];
  for (int i = 1; i < n; i++)
    if (mask & (1 << i)) {
      double tmp = 0;
      tmp += p[i][winner] * mem(mask ^ (1 << i), i);
      tmp += p[winner][i] * mem(mask ^ (1 << i), winner);
      ret = max(ret, tmp);
    }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    p[i][0] = 1;
    for (int j = 1; j <= n; j++) cin >> p[i][j];
  }
  n++;
  cout << setprecision(10) << fixed << mem((1 << n) - 2, 0) << endl;
  return 0;
}
