#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int L;
  cin >> L;
  int n = (1 << L);
  vector<vector<double> > prob(n, vector<double>(n, 0));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> prob[i][j];
      prob[i][j] /= 100.;
    }
  }
  vector<vector<double> > pr(L + 1, vector<double>(n));
  for (int i = 0; i < n; ++i) {
    pr[0][i] = 1;
  }
  vector<vector<double> > dp(L + 1, vector<double>(n));
  for (int i = 1; i <= L; ++i) {
    for (int j = 0; j < n; ++j) {
      int l = j - j % (1 << i);
      int r = l + (1 << i);
      int m = (l + r) / 2;
      int score = 1 << (i - 1);
      if (j < m) {
        l = m;
      } else {
        r = m;
      }
      for (int x = l; x < r; ++x) {
        pr[i][j] += pr[i - 1][j] * pr[i - 1][x] * prob[j][x];
      }
      for (int x = l; x < r; ++x) {
        double val = dp[i - 1][j] + dp[i - 1][x] + score * pr[i][j];
        if (val > dp[i][j]) {
          dp[i][j] = val;
        }
      }
    }
  }
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    ans = max(ans, dp[L][i]);
  }
  cout.precision(10);
  cout << fixed;
  cout << ans << endl;
  return 0;
}
