#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
void minimize(X &x, const Y &y) {
  if (x > y) x = y;
}
template <class X, class Y>
void maximize(X &x, const Y &y) {
  if (x < y) x = y;
}
template <class T>
T Abs(const T &x) {
  return (x < 0 ? -x : x);
}
double f[(1LL << (7)) + 3][7 + 3];
double win[(1LL << (7)) + 3][7 + 3];
double prob[(1LL << (7)) + 3][(1LL << (7)) + 3];
int n;
void init(void) {
  cin >> n;
  for (int i = 0, _n = ((1LL << (n))); i < _n; i = i + 1)
    for (int j = 0, _n = ((1LL << (n))); j < _n; j = j + 1) {
      int x;
      cin >> x;
      prob[i][j] = 1.0 * x / 100;
    }
}
bool canMeet(int x, int y, int lv) {
  if (lv < 1) return false;
  return ((x ^ y) >> (lv - 1)) == 1;
}
double probWin(int team, int lv) {
  if (!(std::isnan(win[team][lv]))) return win[team][lv];
  if (lv == 0) return 1.0;
  double res = 0.0;
  for (int other = 0, _n = ((1LL << (n))); other < _n; other = other + 1)
    if (canMeet(team, other, lv))
      res += prob[team][other] * probWin(other, lv - 1);
  return win[team][lv] = res * probWin(team, lv - 1);
}
double dp(int team, int lv) {
  if (!(std::isnan(f[team][lv]))) return f[team][lv];
  if (lv == 0) return 0;
  double res = -1;
  for (int other = 0, _n = ((1LL << (n))); other < _n; other = other + 1)
    if (canMeet(team, other, lv)) {
      double prevScore = dp(team, lv - 1) + dp(other, lv - 1);
      double matchScore = probWin(team, lv) * (1LL << (lv - 1));
      maximize(res, prevScore + matchScore);
    }
  assert(res >= 0);
  return f[team][lv] = res;
}
void process(void) {
  memset(win, -1, sizeof win);
  memset(f, -1, sizeof f);
  assert((std::isnan(f[0][0])) && (std::isnan(win[0][0])));
  double res = -1;
  for (int i = 0, _n = ((1LL << (n))); i < _n; i = i + 1)
    maximize(res, dp(i, n));
  printf("%.12lf\n", res);
}
int main(void) {
  init();
  process();
  return 0;
}
