#include <bits/stdc++.h>
using namespace std;
double a[19][19];
bool bz[19];
int b[19];
double f[270000][19];
int n;
int _2[19];
int main() {
  cin >> n;
  _2[0] = 1;
  for (int i = 1; i <= n; i++) _2[i] = _2[i - 1] * 2;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%lf", &a[i][j]);
  f[1][1] = 1;
  for (int s = 3; s < _2[n]; s += 2)
    for (int i = 1; i <= n; i++)
      if (s & _2[i - 1])
        for (int j = 1; j <= n; j++)
          if (s & _2[j - 1] && i != j)
            f[s][i] = max(f[s][i], f[s - _2[j - 1]][i] * a[i][j] +
                                       f[s - _2[i - 1]][j] * a[j][i]);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, f[_2[n] - 1][i]);
  printf("%.7lf", ans);
}
