#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 7;
const int MAXS = (1 << 6) + 7;
bool NP[MAXS][MAXS][MAXN];
int n, ms;
int ip[MAXS][MAXS];
long double p[MAXS][MAXS];
long double pd[MAXS][MAXN];
long double dp[MAXS][MAXN];
void init();
void input();
void work();
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d", &n);
  ms = 1 << n;
  for (int i = 0; i < ms; ++i)
    for (int j = 0; j < ms; ++j) scanf("%d", &ip[i][j]);
}
void work() {
  for (int i = 0; i < ms; ++i)
    for (int v = 0; v < ms; ++v)
      for (int j = 1; j <= n; ++j)
        NP[i][v][j] = ((i ^ v) && (i >> j) == (v >> j) &&
                       ((i >> (j - 1) & 1) ^ (v >> (j - 1) & 1)));
  for (int i = 0; i < ms; ++i)
    for (int j = 0; j < ms; ++j)
      p[i][j] = static_cast<long double>(ip[i][j]) / 100;
  for (int i = 0; i < ms; ++i) pd[i][0] = 1;
  for (int j = 1; j <= n; ++j) {
    for (int i = 0; i < ms; ++i) {
      for (int v = 0; v < ms; ++v) {
        if (NP[i][v][j]) {
          pd[i][j] += pd[v][j - 1] * p[i][v];
        }
      }
      pd[i][j] *= pd[i][j - 1];
    }
  }
  for (int i = 0; i < ms; ++i) dp[i][0] = 0;
  long double maxi;
  for (int j = 1; j <= n; ++j) {
    for (int i = 0; i < ms; ++i) {
      maxi = 0;
      for (int v = 0; v < ms; ++v) {
        if (NP[i][v][j])
          maxi = (((maxi) > (dp[v][j - 1])) ? (maxi) : (dp[v][j - 1]));
      }
      dp[i][j] = maxi + dp[i][j - 1] + (1 << (j - 1)) * pd[i][j];
    }
  }
  maxi = 0;
  for (int i = 0; i < ms; ++i)
    maxi = (((maxi) > (dp[i][n])) ? (maxi) : (dp[i][n]));
  printf("%.13lf\n", static_cast<double>(maxi));
}
