#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  long double mat[18][18];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> mat[i][j];
  int op = n - 1;
  int lim = 1 << op;
  long double dp[lim];
  memset(dp, 0, sizeof(dp));
  dp[0] = 1;
  for (int mask = 1; mask < lim; mask++) {
    for (int bit = 0; bit < op; bit++) {
      if (mask & (1 << bit)) {
        for (int b2 = bit + 1; b2 < op; b2++) {
          if (mask & (1 << b2)) {
            auto probA = mat[b2 + 1][bit + 1] * dp[mask ^ (1 << bit)];
            auto probB = mat[bit + 1][b2 + 1] * dp[mask ^ (1 << b2)];
            dp[mask] = max(dp[mask], probA + probB);
          }
        }
        auto probJ = mat[0][bit + 1] * dp[mask ^ (1 << bit)];
        dp[mask] = max(dp[mask], probJ);
      }
    }
  }
  cout << fixed << setprecision(10) << dp[lim - 1] << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
