#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50 + 10, MAXLEN = 20 + 10;
const int MAXSTATUS = (1 << 20) + 10;
int N, M;
char str[MAXN][MAXLEN];
long long bad[MAXSTATUS];
long double f[MAXSTATUS];
int main() {
  scanf("%d", &N);
  for (int i = (0), iend = (N); i < iend; ++i) scanf("%s", str[i]);
  M = strlen(str[0]);
  for (int i = (0), iend = (N); i < iend; ++i)
    for (int j = (0), jend = (i); j < jend; ++j) {
      long long diff = 0;
      for (int idx = (0), idxend = (M); idx < idxend; ++idx) {
        if (str[i][idx] == str[j][idx]) diff |= 1 << idx;
      }
      bad[diff] |= 1ll << i, bad[diff] |= 1ll << j;
    }
  for (int S = (1 << M) - 1, Send = (0); S >= Send; --S) {
    for (int i = (0), iend = (M); i < iend; ++i)
      if (((S >> (i)) & 1)) bad[S ^ (1 << i)] |= bad[S];
  }
  for (int S = (1 << M) - 1, Send = (0); S >= Send; --S) {
    for (int i = (0), iend = (M); i < iend; ++i)
      if (!((S >> (i)) & 1)) {
        f[S] += f[S | (1 << i)] / (M - __builtin_popcount(S));
      }
    f[S] += (long double)(__builtin_popcountll(bad[S])) / N;
  }
  printf("%.10Lf\n", f[0]);
  return 0;
}
