#include <bits/stdc++.h>
using namespace std;
int N;
double p[64][64], hp[64][7];
double memo[65][64];
double doit(int i, int b) {
  if (i == (1 << N)) return 0.0;
  double& ret = memo[i][b];
  if (ret != -1.0) return ret;
  for (int j = 0; j < N; j++)
    if ((i & ((1 << (j + 1)) - 1)) == 0) b &= ~(1 << j);
  double cur = 0.0;
  ret = doit(i + 1, b);
  for (int h = 0; h < N; h++) {
    if (b & (1 << h)) break;
    b |= (1 << h);
    cur += (1 << h) * hp[i][h + 1];
    ret = max(ret, cur + doit(i + 1, b));
  }
  return ret;
}
int main() {
  while (cin >> N) {
    for (int i = 0; i < (1 << N); i++)
      for (int j = 0; j < (1 << N); j++) {
        cin >> p[i][j];
        p[i][j] /= 100.0;
      }
    memset(hp, 0, sizeof(hp));
    for (int i = 0; i < (1 << N); i++) hp[i][0] = 1.0;
    for (int h = 1; h <= N; h++)
      for (int i = 0; i < (1 << N); i++) {
        int bs = (i >> h) << h;
        int be = (((i >> h) + 1) << h) - 1;
        double cur = 0.0;
        for (int j = bs; j <= be; j++)
          if ((j >> (h - 1)) != (i >> (h - 1))) {
            cur += hp[j][h - 1] * p[i][j];
          }
        hp[i][h] = hp[i][h - 1] * cur;
      }
    for (int i = 0; i <= (1 << N); i++)
      for (int j = 0; j < (1 << N); j++) {
        memo[i][j] = -1.0;
      }
    printf("%.10lf\n", doit(0, 0));
  }
}
