#include <bits/stdc++.h>
using namespace std;
double w[200][200];
double opp[200][200];
double s[200][200];
int main() {
  int rounds;
  cin >> rounds;
  int teams = pow(2, rounds);
  for (int i = 0; i < teams; i++) {
    for (int j = 0; j < teams; j++) {
      cin >> w[i][j];
      w[i][j] /= 100;
    }
  }
  for (int i = 0; i < teams; i++) {
    opp[0][i] = 1;
    s[0][i] = 0;
  }
  for (int round = 1; round <= rounds; round++) {
    for (int team = 0; team < teams; team++) {
      for (int k = 0; k < teams; k++) {
        if ((k >> round) == (team >> round) &&
            (k >> round - 1) != (team >> round - 1))
          opp[round][team] += opp[round - 1][k] * w[team][k];
      }
      opp[round][team] *= opp[round - 1][team];
    }
  }
  for (int round = 1; round <= rounds; round++) {
    for (int team = 0; team < teams; team++) {
      for (int k = 0; k < teams; k++) {
        if ((k >> round) == (team >> round) &&
            (k >> round - 1) != (team >> round - 1))
          s[round][team] =
              max(s[round][team], s[round - 1][team] + s[round - 1][k] +
                                      opp[round][team] * pow(2, round - 1));
      }
    }
  }
  double ans = 0;
  for (int i = 0; i < teams; i++) {
    ans = max(ans, s[rounds][i]);
  }
  printf("%.10f\n", ans);
  return 0;
}
