#include <bits/stdc++.h>
using namespace std;
const int max_n = 1 << 6;
double P[max_n][max_n][max_n];
bool PV[max_n][max_n][max_n];
double E[max_n][max_n][max_n];
bool EV[max_n][max_n][max_n];
double getProb(int level, int index, int team, vector<vector<double>>& matrix) {
  if (level == 0) {
    return team == index ? 1.0 : 0.0;
  }
  double& mem = P[level][index][team];
  bool& mem_v = PV[level][index][team];
  if (mem_v) {
    return mem;
  }
  int n = matrix.size();
  int left = index * 2;
  int right = index * 2 + 1;
  double prob = 0.0;
  for (int enemy = 0; enemy < n; enemy++) {
    double win_prob = matrix[team][enemy];
    prob += getProb(level - 1, left, team, matrix) *
            getProb(level - 1, right, enemy, matrix) * win_prob;
    prob += getProb(level - 1, left, enemy, matrix) *
            getProb(level - 1, right, team, matrix) * win_prob;
  }
  mem = prob;
  mem_v = true;
  return prob;
}
double getExpect(int level, int index, int team,
                 vector<vector<double>>& matrix) {
  if (level == 0) {
    return 0.0;
  }
  double& mem = E[level][index][team];
  bool& mem_v = EV[level][index][team];
  if (mem_v) {
    return mem;
  }
  int n = matrix.size();
  int reward = 1 << (level - 1);
  double reward_prob = reward * getProb(level, index, team, matrix);
  int left = index * 2;
  int right = index * 2 + 1;
  double best_expect = 0.0;
  for (int enemy = 0; enemy < n; enemy++) {
    double cur_a = getExpect(level - 1, left, team, matrix) +
                   getExpect(level - 1, right, enemy, matrix) + reward_prob;
    double cur_b = getExpect(level - 1, left, enemy, matrix) +
                   getExpect(level - 1, right, team, matrix) + reward_prob;
    best_expect = max(best_expect, max(cur_a, cur_b));
  }
  mem = best_expect;
  mem_v = true;
  return best_expect;
}
int main() {
  memset(PV, false, sizeof(PV));
  memset(EV, false, sizeof(EV));
  int n_level;
  cin >> n_level;
  int n = 1 << n_level;
  vector<vector<double>> matrix(n, vector<double>(n));
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < n; k++) {
      int temp;
      cin >> temp;
      matrix[i][k] = temp / 100.0;
    }
  }
  double ans = 0.0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, getExpect(n_level, 0, i, matrix));
  }
  cout << fixed << setprecision(10) << ans << endl;
}
