#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int i, j, n, l, r, k, x, y, z, m, t;
int wh[1050000], sum[1050000], v[1050000];
long long d[60], h[1050000];
double f[1050000];
char a[N][N];
map<string, int> g;
void dfs(int x) {
  if (wh[x]) return;
  wh[x] = 1;
  if (v[x]) return;
  int tot = 0, y;
  for (y = x ^ (d[m] - 1); y; y -= y & (-y)) {
    tot++;
    dfs(x + (y & (-y)));
    f[x] += f[x + (y & (-y))];
  }
  f[x] = f[x] / (double)tot + sum[x];
}
void work() {
  long long i, j, k, cur;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (i != j) {
        cur = 0;
        for (k = 0; k < m; k++)
          if (a[i][k] == a[j][k]) cur |= d[k];
        h[cur] |= d[i - 1];
      }
  for (i = d[m] - 1; i >= 0; i--) {
    for (j = i; j; j -= j & (-j)) h[i ^ (j & (-j))] |= h[i];
    for (j = h[i]; j; j -= j & (-j)) sum[i]++;
    if (h[i] == 0) v[i] = 1;
  }
}
int main() {
  d[0] = 1;
  for (i = 1; i <= 52; i++) d[i] = d[i - 1] * 2;
  cin >> n;
  if (n == 1) {
    printf("0");
    return 0;
  }
  for (i = 1; i <= n; i++) cin >> a[i];
  m = (int)strlen(a[1]);
  work();
  dfs(0);
  printf("%.10lf", f[0] / (double)n);
}
