#include <bits/stdc++.h>
int n, m, k;
long long fulln, fullm;
char s[60][30];
double dp[1100000], prob[30];
long long confuse[1100000];
int cnt[1100000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%s", s[i]);
  m = strlen(s[0]);
  fulln = (1 << n) - 1;
  fullm = (1 << m) - 1;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      int tmp = 0;
      for (int k = 0; k < m; ++k)
        if (s[i][k] == s[j][k]) tmp |= 1 << k;
      confuse[tmp] |= (1LL << i) | (1LL << j);
    }
  for (int i = fullm; ~i; --i)
    if (confuse[i])
      for (int j = 0; j < m; ++j)
        if (i & (1 << j)) confuse[i ^ (1 << j)] |= confuse[i];
  for (int i = 0; i <= fullm; ++i)
    for (int j = 0; j < n; ++j)
      if (!(confuse[i] & (1LL << j))) ++cnt[i];
  dp[0] = 1.0;
  for (int i = 0; i < fullm; ++i) {
    int x = 0;
    for (int j = 0; j < m; ++j)
      if (i & (1 << j)) ++x;
    double tmp = dp[i] / (m - x);
    for (int j = 0; j < m; ++j)
      if (!(i & (1 << j)) && n > cnt[i]) {
        dp[i | (1 << j)] += tmp * (n - cnt[i | (1 << j)]) / (n - cnt[i]);
        prob[x + 1] += tmp * (cnt[i | (1 << j)] - cnt[i]) / (n - cnt[i]);
      }
  }
  double ans = 0;
  for (int i = 1; i <= m; ++i) ans += i * prob[i];
  printf("%.12f\n", ans);
  return 0;
}
