#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int n, m, U;
long long bin[N], f[1 << 20 | 9];
double g[1 << 20 | 9], ans;
char s[N][N];
inline void read(int &i) {
  i = 0;
  char c = getchar();
  bool j = 0;
  for (; !isdigit(c); c = getchar())
    if (c == '-') j = 1;
  for (; isdigit(c); c = getchar()) i = (i << 1) + (i << 3) + c - '0';
  i = j ? -i : i;
}
int main() {
  read(n);
  for (int i = 0; i < n; ++i) scanf("%s", s[i]);
  m = strlen(s[0]);
  U = (1 << m) - 1;
  for (int i = bin[0] = 1; i <= 50; ++i) bin[i] = bin[i - 1] << 1;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      int same = 0;
      for (int k = 0; k < m; ++k)
        if (s[i][k] == s[j][k]) same |= bin[k];
      f[same] |= bin[i] | bin[j];
    }
  for (int i = U - 1; ~i; --i)
    for (int j = 0; j < m; ++j)
      if (!(i >> j & 1)) f[i] |= f[i ^ bin[j]];
  g[0] = 1;
  for (int i = 0, c; i < U; ++i) {
    c = 0;
    for (int j = 0; j < m; ++j)
      if (i >> j & 1) c++;
    for (int j = 0; j < m; ++j)
      if (!(i >> j & 1)) g[i ^ bin[j]] += g[i] / (m - c);
    for (int j = 0; j < n; ++j)
      if (f[i] & bin[j]) ans += g[i];
  }
  ans /= n;
  printf("%.10lf\n", ans);
  return 0;
}
