#include <bits/stdc++.h>
using namespace std;
long long b[1 << 21];
double dp[1 << 21];
double prob[21];
string s[55];
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  if (n == 1) {
    puts("0.0");
    return 0;
  }
  for (int i = 0; i < n; i++) cin >> s[i];
  m = s[0].length();
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      long long msk = 0;
      for (int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) msk |= (1ll << k);
      b[msk] |= (1ll << i) | (1ll << j);
    }
  }
  for (int i = (1 << m) - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      if (i & (1 << j)) b[i - (1 << j)] |= b[i];
    }
  }
  dp[0] = 1;
  for (int msk = 0; msk < (1 << m); msk++) {
    if (b[msk] == 0) continue;
    int cur = __builtin_popcountll(msk);
    long long p = __builtin_popcountll(b[msk]);
    double curp = dp[msk] / (m - cur);
    for (int j = 0; j < m; j++) {
      if (msk & (1 << j)) continue;
      int nmsk = msk + (1 << j);
      double nprob =
          1.0 * (__builtin_popcountll(b[msk]) - __builtin_popcountll(b[nmsk])) /
          __builtin_popcountll(b[msk]);
      dp[nmsk] += curp * (1 - nprob);
      prob[cur + 1] += curp * nprob;
    }
  }
  double ans = 0;
  for (int i = 1; i <= m; i++) ans += prob[i] * i;
  printf("%.9lf\n", ans);
  return 0;
}
