#include <bits/stdc++.h>
using namespace std;
int g[70][70];
double dp[70][10], win[70][10];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (1 << n); i++)
    for (int j = 0; j < (1 << n); j++) scanf("%d", &g[i][j]);
  for (int i = 0; i < (1 << n); i++) win[i][0] = 1;
  for (int r = 1; r <= n; r++) {
    for (int i = 0; i < (1 << n); i++) {
      int x = 1 << (r - 1), t = i / x, L, R;
      if (t & 1)
        L = x * (t - 1), R = x * (t)-1;
      else
        L = x * (t + 1), R = x * (t + 2) - 1;
      for (int j = L; j <= R; j++) {
        win[i][r] += win[i][r - 1] * g[i][j] / 100.0 * win[j][r - 1];
      }
      for (int j = L; j <= R; j++) {
        dp[i][r] = max(dp[i][r], win[i][r] * (x) + dp[j][r - 1] + dp[i][r - 1]);
      }
    }
  }
  double ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    ans = max(ans, dp[i][n]);
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
