#include <bits/stdc++.h>
using namespace std;
int n, slen;
char s[50][21];
long long unsure[1 << 20];
int nsure[1 << 20];
double dp[1 << 20];
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%s", s[i]);
  slen = strlen(s[0]);
  double ret = 0;
  memset(unsure, 0, sizeof(unsure));
  for (int i = (0); i < (n); ++i)
    for (int j = (i + 1); j < (n); ++j) {
      int mask = 0;
      for (int k = (0); k < (slen); ++k)
        if (s[i][k] == s[j][k]) mask |= 1 << k;
      unsure[mask] |= (1LL << i) | (1LL << j);
    }
  for (int i = (1 << slen) - 1; i >= 0; --i)
    if (unsure[i])
      for (int j = (0); j < (slen); ++j)
        if (i & (1 << j)) unsure[i - (1 << j)] |= unsure[i];
  memset(nsure, 0, sizeof(nsure));
  for (int i = (0); i < (1 << slen); ++i)
    for (int j = (0); j < (n); ++j)
      if ((unsure[i] & (1LL << j)) == 0) ++nsure[i];
  for (int j = (1 << slen) - 1; j >= 0; --j) {
    if (nsure[j] == n) {
      dp[j] = 0;
      continue;
    }
    double sum = 0;
    int cnt = 0;
    for (int k = (0); k < (slen); ++k)
      if ((j & (1 << k)) == 0) {
        int now = nsure[j + (1 << k)] - nsure[j];
        cnt += n - nsure[j];
        sum += now + (n - nsure[j] - now) * (1 + dp[j + (1 << k)]);
      }
    dp[j] = sum / cnt;
  }
  printf("%.9lf\n", dp[0]);
}
int main() {
  run();
  return 0;
}
