#include <bits/stdc++.h>
const double pi = acos(-1.0);
const int maxn = 0;
const int maxm = 0;
using namespace std;
char c[55][55];
long long a[(1 << 20) + 10];
double dp[(1 << 20) + 5];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%s", c[i]);
  int len = strlen(c[0]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      long long t = 0;
      for (int k = 0; k < len; k++)
        if (c[i][k] == c[j][k]) t |= (1LL << k);
      a[t] |= (1LL << i) | (1LL << j);
    }
  for (int s = (1 << len) - 1; s >= 0; s--) {
    for (int i = 0; i < len; i++) {
      if (s & (1 << i)) a[s ^ (1 << i)] |= a[s];
    }
  }
  dp[0] = 1;
  double ans = 0;
  for (int s = 0; s < (1 << len); s++) {
    int c1 = 0, c2 = 0;
    for (int i = 0; i < len; i++) {
      if (s & (1 << i)) c1++;
    }
    for (int i = 0; i < len; i++) {
      if (!(s & (1 << i))) {
        dp[s ^ (1 << i)] += dp[s] / (double)(len - c1);
      }
    }
    for (int i = 0; i < n; i++)
      if (a[s] & (1LL << i)) c2++;
    ans += dp[s] * (double)c2 / (double)n;
  }
  printf("%.10lf\n", ans);
  return 0;
}
