#include <bits/stdc++.h>
using namespace std;
int n;
double p[18][18], f[1 << 18];
int main() {
  f[1] = 1;
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> p[i][j];
  for (int S = 2; S < (1 << n); ++S)
    for (int i = 0; i < n - 1; ++i)
      if (S >> i & 1)
        for (int j = i + 1; j < n; ++j)
          if (S >> j & 1)
            f[S] = max(f[S],
                       f[S ^ (1 << i)] * p[j][i] + f[S ^ (1 << j)] * p[i][j]);
  cout << f[(1 << n) - 1];
}
