#include <bits/stdc++.h>
using namespace std;
int n;
double p[66][66];
double dp[7][66];
double pp[7][66];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (1 << n); i++) {
    for (int j = 1; j <= (1 << n); j++) {
      cin >> p[i][j];
      p[i][j] /= 100;
    }
  }
  for (int i = 1; i <= (1 << n); i++) {
    pp[0][i] = 1;
  }
  for (int r = 1; r <= n; r++) {
    int block = (1 << r);
    int matches = (1 << (n - r));
    for (int j = 0; j < matches; j++) {
      for (int i = j * block + 1; i <= j * block + block / 2; i++) {
        for (int k = j * block + block / 2 + 1; k <= (j + 1) * block; k++)
          pp[r][i] += pp[r - 1][k] * p[i][k];
        pp[r][i] *= pp[r - 1][i];
      }
      for (int i = j * block + block / 2 + 1; i <= (j + 1) * block; i++) {
        for (int k = j * block + 1; k <= j * block + block / 2; k++)
          pp[r][i] += pp[r - 1][k] * p[i][k];
        pp[r][i] *= pp[r - 1][i];
      }
      for (int i = j * block + 1; i <= j * block + block / 2; i++) {
        for (int k = j * block + block / 2 + 1; k <= (j + 1) * block; k++)
          dp[r][i] = max(dp[r][i], dp[r - 1][k]);
        dp[r][i] += dp[r - 1][i];
        dp[r][i] += pp[r][i] * (1 << (r - 1));
      }
      for (int i = j * block + block / 2 + 1; i <= (j + 1) * block; i++) {
        for (int k = j * block + 1; k <= j * block + block / 2; k++)
          dp[r][i] = max(dp[r][i], dp[r - 1][k]);
        dp[r][i] += dp[r - 1][i];
        dp[r][i] += pp[r][i] * (1 << (r - 1));
      }
    }
  }
  double ans = 0;
  for (int i = 1; i <= (1 << n); i++) {
    ans = max(ans, dp[n][i]);
  }
  printf("%0.10lf\n", ans);
  return 0;
}
