#include <bits/stdc++.h>
using namespace std;
int n;
long double p[18][18], dp[1 << 18];
bool bit(int mask, int num) {
  if (mask & (1 << num)) return 1;
  return 0;
}
void obr(int mask) {
  dp[mask] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j && !bit(mask, i) && !bit(mask, j))
        dp[mask] = max(dp[mask], dp[mask | (1 << i)] * p[j][i] +
                                     dp[mask | (1 << j)] * p[i][j]);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> p[i][j];
  for (int i = 0; i < (1 << n); i++)
    if (i & 1) dp[i] = 0;
  dp[(1 << n) - 2] = 1;
  for (int i = (1 << n) - 3; i >= 0; i--) obr(i);
  cout.precision(9);
  cout << fixed << dp[0];
}
