#include <bits/stdc++.h>
using namespace std;
int n;
double prob[65][65], P[65][7], S[65][7], ans = 0.0;
pair<int, int> opp[65][7];
void initialize() {
  for (int i = 0; i <= 64; i++) {
    P[i][0] = 1.0;
    S[i][0] = 0.0;
  }
}
void find_opp(int x, int round) {
  int num = 1 << (round - 1);
  int block_num = x / num + (x % num != 0);
  if (block_num & 1) {
    opp[x][round] = make_pair(block_num * num + 1, (block_num + 1) * num);
  } else {
    block_num--;
    opp[x][round] = make_pair((block_num - 1) * num + 1, block_num * num);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= (1 << n); i++)
    for (int j = 1; j <= (1 << n); j++) {
      cin >> prob[i][j];
      prob[i][j] /= 100;
    }
  initialize();
  for (int r = 1; r <= n; r++) {
    for (int i = 1; i <= (1 << n); i++) {
      find_opp(i, r);
      double sum = 0.0, curr = 0.0;
      for (int j = opp[i][r].first; j <= opp[i][r].second; j++) {
        sum += P[j][r - 1] * prob[i][j];
        curr = max(curr, S[j][r - 1]);
      }
      P[i][r] = P[i][r - 1] * sum;
      S[i][r] = S[i][r - 1] + curr + P[i][r] * ((double)(1 << (r - 1)));
      if (r == n) ans = max(ans, S[i][r]);
    }
  }
  cout << setprecision(10) << ans;
  return 0;
}
