#include <bits/stdc++.h>
using namespace std;
int n, m, c[1 << 21];
double ans[1 << 21], res;
char s[55][25];
long long bin[55], rbq[1 << 21];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  m = strlen(s[0]);
  bin[0] = 1;
  for (int i = 1; i <= max(n, m); i++) bin[i] = (bin[i - 1] << 1);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j) {
        int sm = 0;
        for (int k = 0; k < m; k++)
          if (s[i][k] == s[j][k]) sm |= (1 << k);
        rbq[sm] |= bin[i];
      }
  for (int i = bin[m] - 1; i >= 0; i--)
    for (int j = 0; j < m; j++)
      if (i & bin[j]) rbq[i ^ bin[j]] |= rbq[i];
  for (int i = 0; i < bin[m]; i++)
    for (int j = c[i] = 0; j < n; j++)
      if (rbq[i] & bin[j]) c[i]++;
  ans[0] = 1;
  for (int i = 0; i < bin[m]; i++) {
    int cc = 0;
    for (int j = 0; j < m; j++)
      if (i & bin[j]) cc++;
    for (int j = 0; j < m; j++)
      if (!(i & bin[j])) ans[i | bin[j]] += ans[i] / (m - cc);
    res += c[i] * ans[i];
  }
  printf("%.10f\n", res / n);
  return 0;
}
