#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z, k, w;
int N;
long double A[100][100];
long double ans[10][100];
;
long double win_prob[10][100], dp[10][100];
long double output;
double fk;
int main() {
  scanf("%d", &n);
  N = (1 << n);
  for (int i = (1); i <= (N); i++)
    for (int j = (1); j <= (N); j++) {
      scanf("%lf", &fk);
      A[i][j] = (long double)(fk) / 100.0;
    }
  for (int i = (1); i <= (N); i++) win_prob[0][i] = 1.0;
  for (int times = (1); times <= (n); times++) {
    k = 1 << times;
    for (int i = (1); i <= (N); i++) {
      for (int j = (1); j <= (N); j++) {
        if ((i - 1) / k == (j - 1) / k &&
            (i - 1) / (k / 2) != (j - 1) / (k / 2)) {
          win_prob[times][i] += win_prob[times - 1][j] * A[i][j];
        }
      }
      win_prob[times][i] *= win_prob[times - 1][i];
      for (int j = (1); j <= (N); j++) {
        if ((i - 1) / k == (j - 1) / k &&
            (i - 1) / (k / 2) != (j - 1) / (k / 2)) {
          dp[times][i] =
              max(dp[times][i], dp[times - 1][i] + dp[times - 1][j] +
                                    win_prob[times][i] * (double)(k / 2));
        }
      }
    }
  }
  for (int i = (1); i <= (N); i++) output = max(output, dp[n][i]);
  printf("%.12lf\n", (double)output);
  return 0;
}
