#include <bits/stdc++.h>
using namespace std;
int N;
double adj[100][100];
double dp[10][100], val[10][100];
int main() {
  scanf("%d", &N);
  int NN = 1 << N;
  for (int i = 0; i < NN; i++)
    for (int j = 0; j < NN; j++) {
      int a;
      scanf("%d", &a);
      adj[i][j] = double(a) / 100.0;
    }
  for (int i = 0; i < NN; i++) dp[0][i] = 1.0;
  for (int n = 1; n <= N; n++) {
    for (int i = 0; i < NN; i++) {
      int sz = 1 << (n - 1), v = (i / sz) ^ 1;
      for (int j = v * sz; j < (v + 1) * sz; j++) {
        dp[n][i] += dp[n - 1][i] * dp[n - 1][j] * adj[i][j];
        val[n][i] = max(val[n][i], val[n - 1][j]);
      }
      val[n][i] += val[n - 1][i];
      val[n][i] += dp[n][i] * sz;
    }
  }
  double ans = 0.0;
  for (int i = 0; i < NN; i++) ans = max(ans, val[N][i]);
  printf("%.12lf\n", ans);
}
