#include <bits/stdc++.h>
using namespace std;
const int N = 20, M = 55;
int n, m;
char s[M][M];
double f[(1 << N) + 5];
long long b[(1 << N) + 5];
int cnt[(1 << N) + 5];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  m = strlen(s[1]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int t = 0;
      for (int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) t |= (1 << k);
      b[t] |= (1ll << i) | (1ll << j);
    }
  for (int i = (1 << m) - 1; i >= 1; i--) {
    for (int j = 0; j < m; j++)
      if (i >> j & 1) b[i ^ (1 << j)] |= b[i];
  }
  for (int i = 0; i < (1 << m); i++)
    for (int j = 0; j < n; j++)
      if (b[i] >> j & 1) cnt[i]++;
  for (int i = (1 << m) - 2; i >= 0; i--) {
    if (!cnt[i]) continue;
    int tot = m - __builtin_popcount(i);
    for (int j = 0; j < m; j++)
      if (!(i >> j & 1)) {
        f[i] += 1.0 * f[i | (1 << j)] / tot * 1.0 * cnt[i | (1 << j)] / cnt[i];
      }
    f[i]++;
  }
  printf("%.10lf", f[0]);
  return 0;
}
