#include <bits/stdc++.h>
using namespace std;
int n;
string a[55];
long long f[(1LL << (21))];
double fac[55];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int l = a[0].size();
  fac[0] = 1;
  for (int i = 1; i <= l; i++) fac[i] = fac[i - 1] * i;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int s = 0;
      for (int k = 0; k < l; k++)
        if (a[i][k] == a[j][k]) s |= (1LL << (k));
      f[s] |= (1LL << (i)) | (1LL << (j));
    }
  }
  double res = 0;
  for (int s = (1LL << (l)) - 1; s >= 0; s--) {
    for (int k = 0; k < l; k++)
      if (s >> k & 1) f[s ^ (1LL << (k))] |= f[s];
  }
  for (int s = 0; s < (1LL << (l)); s++) {
    int nturn = __builtin_popcount(s);
    for (int k = 0; k < l; k++)
      if (s >> k & 1) {
        int nreveal = 0;
        long long x = f[s] ^ f[s ^ (1LL << (k))];
        while (x) {
          x -= x & (-x);
          nreveal++;
        }
        res += (fac[nturn - 1] / fac[l] * fac[l - nturn]) * nturn * nreveal / n;
      }
  }
  printf("%.15lf", res);
}
