#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000006;
int n, m;
vector<string> vs;
long long su[1 << 20];
int cnt[1 << 20], ppcnt[1 << 20];
int popcount(long long x) {
  int c = 0;
  while (x) {
    if (x & 1) c++;
    x >>= 1;
  }
  return c;
}
void pp3() {
  memset(su, 0, sizeof su);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      int x = 0, b = 1;
      for (int k = 0; k < m; ++k) {
        if (vs[i][k] == vs[j][k]) x |= b;
        b <<= 1;
      }
      su[x] |= (1LL << i) | (1LL << j);
    }
  }
  for (int i = (1 << m) - 1; i >= 0; i--)
    for (int j = 0; j < m; ++j) su[i] |= su[i | (1 << j)];
  for (int i = 0; i < 1 << m; ++i)
    cnt[i] = popcount(su[i]), ppcnt[i] = popcount(i);
}
double res[1 << 20], res2[1 << 20];
char pd[1 << 20], pd2[1 << 20];
double chegar(int X) {
  if (!X) return 1;
  if (pd[X] == -1) {
    pd[X] = 1;
    double ans = 0, val = m - (ppcnt[X] - 1);
    for (int i = 0; i < m; ++i) {
      if ((1 << i) & X) {
        int Y = X ^ (1 << i);
        ans += chegar(Y);
      }
    }
    res[X] = ans / val;
  }
  return res[X];
}
double terminarExatamenteEm(int X) {
  if (!X) return 0;
  if (pd2[X] == -1) {
    pd2[X] = 1;
    double ans = 0, val = m - (ppcnt[X] - 1);
    ;
    for (int i = 0; i < m; ++i) {
      if ((1 << i) & X) {
        int Y = X ^ (1 << i);
        ans += chegar(Y) * ((double)(cnt[Y] - cnt[X]) / (double)n);
      }
    }
    res2[X] = ans / val;
  }
  return res2[X];
}
int main() {
  while (cin >> n) {
    string s;
    vs.clear();
    for (int i = 0; i < n; ++i) {
      cin >> s;
      vs.push_back(s);
    }
    m = int((vs[0]).size());
    if (n == 1) {
      cout << setprecision(15) << fixed << 0. << endl;
    } else {
      pp3();
      memset(pd, -1, sizeof pd);
      memset(pd2, -1, sizeof pd2);
      double ans = 0;
      for (int i = 0; i < (1 << m); ++i) {
        ans += terminarExatamenteEm(i) * ppcnt[i];
      }
      cout << setprecision(15) << fixed << ans << endl;
    }
  }
}
