#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &a) {
  for (const A &it : a) out << it << " ";
  return out;
}
template <class A, class B>
istream &operator>>(istream &in, pair<A, B> &a) {
  return in >> a.first >> a.second;
}
template <class A>
istream &operator>>(istream &in, vector<A> &a) {
  for (A &i : a) in >> i;
  return in;
}
long long poww(const long long &a, long long b,
               const long long &m = 1000000007) {
  if (b == 0) return 1;
  long long x = poww(a, b / 2, m);
  x = x * x % m;
  if (b & 1) x = x * a % m;
  return x;
}
long long ceil(const long long &a, const long long &b) {
  return (a + b - 1) / b;
}
long long n;
long double v[18][18];
long double dp[18][1 << 18];
long double f(long long lst, long long mask) {
  if (__builtin_popcount(mask) == n - 1) return lst == 0;
  long double &ans = dp[lst][mask];
  if (ans >= 0) return ans;
  ans = 0;
  for (long long j = 0; j < n; j++) {
    if (mask & (1 << j) || lst == j) continue;
    ans = max(ans, f(j, mask | (1 << lst)) * v[j][lst] +
                       f(lst, mask | (1 << j)) * v[lst][j]);
  }
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) cin >> v[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < (1 << n); j++) dp[i][j] = -(1e18);
  long double ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      ans = max(ans, f(i, (1 << j)) * v[i][j] + f(j, (1 << i)) * v[j][i]);
    }
  }
  if (n == 1) ans = 1;
  cout << fixed << setprecision(10) << ans;
}
