#include <bits/stdc++.h>
using namespace std;
int n, m;
char words[55][25];
double dp[1 << 20];
long long mark[1 << 20];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (n); i++) scanf("%s", words[i]);
  m = strlen(words[0]);
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (i); j++) {
      int msk = 0;
      for (int k = 0; k < (m); k++)
        if (words[i][k] != words[j][k]) msk |= 1 << k;
      mark[msk] |= 1ll << i;
      mark[msk] |= 1ll << j;
    }
  for (int msk = 0; msk < (1 << m); msk++) {
    for (int k = 0; k < (m); k++)
      if (msk & (1 << k)) mark[msk] |= mark[msk ^ (1 << k)];
  }
  for (int msk = 0; msk < (1 << m); msk++) {
    dp[msk] = 0;
    if (mark[msk] == 0) continue;
    int moves = __builtin_popcount(msk);
    for (int k = 0; k < m; k++) {
      if ((msk & (1 << k)) == 0) continue;
      int num = __builtin_popcountll(mark[msk]);
      dp[msk] += (dp[msk ^ (1 << k)] + num) / moves;
    }
  }
  printf("%.13f\n", dp[(1 << m) - 1] / n);
  return 0;
}
