#include <bits/stdc++.h>
using namespace std;
char s[60][30];
int n, m;
long long d[(1 << 20) + 10];
double dp[(1 << 20) + 10];
int read() {
  int x = 0, f = 1, c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
int Count(int x) {
  int res = 0;
  while (x) {
    res++;
    x = x & (x - 1ll);
  }
  return res;
}
int main() {
  n = read();
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  m = strlen(s[1]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int same = 0;
      for (int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) same |= 1 << k;
      d[same] |= (1ll << i);
      d[same] |= (1ll << j);
    }
  for (int mask = (1 << m) - 1; mask >= 0; mask--)
    for (int j = 0; j < m; j++)
      if ((mask >> j) & 1ll) d[mask ^ (1 << j)] |= d[mask];
  dp[0] = 1;
  double ans = 0;
  for (int mask = 0; mask < (1 << m); mask++) {
    int c = Count(mask);
    for (int j = 0; j < m; j++)
      if (((mask >> j) & 1) == 0) dp[mask | (1 << j)] += dp[mask] / (m - c);
    for (int j = 0; j < n; j++)
      if ((d[mask] >> j) & 1ll) ans += dp[mask];
  }
  printf("%.15lf", ans / n);
}
