#include <bits/stdc++.h>
char s[55][22];
double f[1 << 20];
unsigned long long g[1 << 20];
inline int gs(unsigned long long S) {
  int ans = 0;
  while (S) {
    S &= (S - 1);
    ++ans;
  }
  return ans;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%s", s[i]);
  int len = strlen(s[0]);
  memset(g, 0, sizeof(g));
  memset(f, 0, sizeof(f));
  for (int i = 0; i < n - 1; ++i)
    for (int j = i + 1; j < n; ++j) {
      int sta = 0;
      for (int k = 0; k < len; ++k)
        if (s[i][k] == s[j][k]) sta |= 1 << k;
      g[sta] |= 1LL << i;
      g[sta] |= 1LL << j;
    }
  for (int S = (1 << len) - 1; S >= 0; --S)
    for (int i = 0; i < len; ++i)
      if (!(S & (1 << i))) g[S] |= g[S | (1 << i)];
  f[0] = 1;
  double ans = 0;
  for (int S = 0; S < (1 << len); ++S) {
    int siz = gs(S);
    for (int i = 0; i < len; ++i)
      if (!(S & (1 << i))) {
        f[S | (1 << i)] += f[S] / (len - siz);
        ans += (siz + 1) * gs(g[S] ^ g[S | (1 << i)]) * f[S] / (len - siz);
      }
  }
  printf("%.15f\n", ans / n);
  return 0;
}
