#include <bits/stdc++.h>
using namespace std;
int n, l;
char s[53][23];
double dp[1 << 21];
long long diff[1 << 21];
int main() {
  scanf("%d", &n);
  for (int i = 0, _i = n - 1; i <= _i; i++) {
    scanf("%s", s[i]);
  }
  l = strlen(s[0]);
  for (int i = 0, _i = n - 1; i <= _i; i++) {
    for (int j = 0, _i = n - 1; j <= _i; j++) {
      if (i == j) continue;
      int msk = 0;
      for (int k = 0, _i = l - 1; k <= _i; k++) {
        if (s[i][k] != s[j][k]) continue;
        msk |= (1 << k);
      }
      diff[msk] |= (1LL << i);
    }
  }
  for (int msk = (1 << l) - 1, _i = 0; msk >= _i; msk--) {
    int cnt = 0;
    for (int i = 0, _i = l - 1; i <= _i; i++)
      if (!((msk >> i) & 1)) {
        cnt++;
        diff[msk] |= diff[msk | (1 << i)];
      }
    if (!diff[msk]) continue;
    for (int i = 0, _i = l - 1; i <= _i; i++)
      if (!((msk >> i) & 1)) {
        dp[msk] += dp[msk | (1 << i)] *
                   __builtin_popcountll(diff[msk | (1 << i)]) /
                   __builtin_popcountll(diff[msk]);
      }
    dp[msk] = 1 + dp[msk] / cnt;
  }
  printf("%.11lf\n", dp[0]);
  return 0;
}
