#include <bits/stdc++.h>
using namespace std;
double dp[1 << 20];
int d[1 << 20], n;
char s[55][20 + 1];
long long qf[1 << 20];
int done, zt, l;
inline double cnt(long long u) {
  return (double)__builtin_popcount(int(u % (1 << 25))) +
         __builtin_popcount(int(u / (1 << 25)));
}
int cx[300];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  if (n == 1) {
    puts("0");
    return 0;
  }
  qf[0] = (1ll << n) - 1;
  l = strlen(s[0]);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int mask = 0;
      for (int k = 0; k < l; k++)
        if (s[i][k] == s[j][k]) mask |= (1 << k);
      qf[mask] |= (1LL << i) | (1LL << j);
    }
  }
  for (int mask = (1 << l) - 1; mask >= 0; mask--)
    for (int i = 0; i < l; i++)
      if ((mask >> i) & 1) qf[mask ^ (1 << i)] |= qf[mask];
  for (int zt = (1 << l) - 1; zt >= 0; zt--) {
    if (qf[zt] == 0) continue;
    int tot = 0;
    for (int i = 0; i < l; i++)
      if (!(zt & (1 << i))) tot++;
    dp[zt] = 1;
    for (int i = 0; i < l; i++)
      if (!(zt & (1 << i)))
        dp[zt] +=
            dp[zt | (1 << i)] / tot * cnt(qf[zt | (1 << i)]) / cnt(qf[zt]);
  }
  printf("%.15lf\n", dp[0]);
  return 0;
}
