#include <bits/stdc++.h>
using namespace std;
const int maxn = 1048577;
int n, m, s, sz, cnt;
double ans;
long long f[maxn], bin[55];
double dp[maxn];
char c[55][25];
int main() {
  bin[0] = 1;
  for (int i = 1; i <= 50; i++) bin[i] = bin[i - 1] << 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%s", c[i] + 1);
  m = strlen(c[1] + 1);
  sz = bin[m] - 1;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      s = 0;
      for (int k = 1; k <= m; k++)
        if (c[i][k] == c[j][k]) s |= bin[k - 1];
      f[s] |= (bin[i - 1] | bin[j - 1]);
    }
  for (int i = sz; i >= 0; i--)
    for (int j = 0; j < m; j++)
      if (i & bin[j]) f[i ^ bin[j]] |= f[i];
  dp[0] = 1;
  for (int i = 0; i <= sz; i++) {
    cnt = 0;
    for (int j = 0; j < m; j++)
      if (i & bin[j]) cnt++;
    for (int j = 0; j < m; j++)
      if (!(i & bin[j])) dp[i | bin[j]] += dp[i] / (double)(m - cnt);
    for (int j = 0; j < n; j++)
      if (f[i] & bin[j]) ans += dp[i];
  }
  printf("%.15f\n", ans / (double)n);
  return 0;
}
