#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 143;
const long long longinf = 1e18 + 143;
const int N = 55;
const int M = 20;
int n, m;
char s[N][M + 5];
long long bada[1 << M], badb[1 << M];
bool done[1 << M];
int kb[1 << M];
bool same(int i, int j, int mask) {
  for (int x = 0; x < m; x++) {
    if (mask & (1 << x)) {
      if (s[i][x] != s[j][x]) return false;
    }
  }
  return true;
}
double f[1 << M];
int all;
int main() {
  for (int i = 1; i < (1 << M); i++) {
    kb[i] = kb[i - (i & -i)] + 1;
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %s", s[i]);
  }
  m = strlen(s[0]);
  all = (1 << m) - 1;
  int asz = m / 2;
  int bsz = m - m / 2;
  double res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < (1 << m); j++) done[j] = 0;
    for (int mask = 0; mask < (1 << asz); mask++) {
      bada[mask] = 0ll;
      for (int j = 0; j < n; j++) {
        if (i != j && same(i, j, mask)) {
          bada[mask] |= 1ll << j;
        }
      }
    }
    for (int mask = 0; mask < (1 << bsz); mask++) {
      badb[mask] = 0ll;
      for (int j = 0; j < n; j++) {
        if (i != j && same(i, j, mask << asz)) {
          badb[mask] |= 1ll << j;
        }
      }
      for (int maska = 0; maska < (1 << asz); maska++) {
        if ((bada[maska] & badb[mask]) == 0ll) {
          done[(mask << asz) | maska] = 1;
        }
      }
    }
    f[0] = 1;
    for (int mask = 0; mask < (1 << m); mask++) {
      if (done[mask]) {
        res += f[mask] * kb[mask];
      } else {
        double coef = 1.0 / (m - kb[mask]);
        int x = all & ~mask;
        while (x > 0) {
          f[mask | (x & -x)] += f[mask] * coef;
          x -= x & -x;
        }
      }
      f[mask] = 0;
    }
  }
  printf("%.10f\n", res / n);
  return 0;
}
