#include <bits/stdc++.h>
using namespace std;
long double Exp[1 << 20];
int N, M;
char st[64][32];
int Num[1 << 20];
long long Left[1 << 20];
long long Ambiguous[1 << 20];
int GetNum(long long MASK) {
  long long MOD = (1 << 20) - 1;
  return Num[MASK & MOD] + Num[(MASK >> 20) & MOD] + Num[(MASK >> 40) & MOD];
}
int main() {
  while (scanf("%d", &N) != EOF) {
    Num[0] = 0;
    for (int i = 1; i < (1 << 20); i++) Num[i] = Num[i - (i & (-i))] + 1;
    for (int i = 0; i < N; i++) scanf("%s", st[i]);
    M = strlen(st[0]);
    memset(Ambiguous, 0, sizeof(Ambiguous));
    for (int i = 0; i < N; i++)
      for (int j = i + 1; j < N; j++) {
        int samebits = 0;
        for (int k = 0; k < M; k++) {
          if (st[i][k] == st[j][k]) samebits |= 1 << k;
        }
        Ambiguous[samebits] |= (1LL << i) | (1LL << j);
      }
    int UP = (1 << M) - 1;
    for (int mask = UP; mask >= 0; mask--) {
      Exp[mask] = 0;
      int canChoseNum = 0;
      for (int b = 0; b < M; b++) {
        if (mask & (1 << b))
          Ambiguous[mask ^ (1 << b)] |= Ambiguous[mask];
        else
          canChoseNum++;
      }
      long double tpro = 0;
      if (canChoseNum > 0) tpro = (long double)1.0 / canChoseNum;
      if (Ambiguous[mask] == 0) continue;
      for (int b = 0; b < M; b++) {
        if ((mask & (1 << b)) == 0) {
          int nxt = mask | (1 << b);
          Exp[mask] += tpro * (1.0 + Exp[nxt] * GetNum(Ambiguous[nxt]) /
                                         GetNum(Ambiguous[mask]));
        }
      }
    }
    double ans = Exp[0];
    printf("%.10f\n", ans);
  }
  return 0;
}
