#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
using namespace std;
const int N = 52, M = 22;
int n, m;
long long f[1 << M];
long double ans;
char s[N][M + 10];
signed main() {
  scanf("%d", &n);
  for (register int i = 0; i < n; i++) scanf("%s", s[i]);
  m = strlen(s[0]);
  for (register int i = 0; i < n; i++)
    for (register int j = i + 1; j < n; j++) {
      int mask = 0;
      for (register int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) mask |= (1LL << k);
      f[mask] |= (1LL << i) | (1LL << j);
    }
  int Up = (1LL << m) - 1;
  for (register int used = Up; used >= 0; --used) {
    for (register int i = 0; i < m; i++)
      if ((used >> i) & 1) f[used ^ (1LL << i)] |= f[used];
  }
  for (register int used = 0; used <= Up; ++used) {
    int k = __builtin_popcount(used);
    for (register int i = 0; i < m; i++)
      if (!((used >> i) & 1)) {
        long long solve = f[used] ^ f[used ^ (1LL << i)];
        if (solve == 0) continue;
        int x = __builtin_popcountll(solve);
        long double now = x * (k + 1);
        for (register int j = m; j >= m - k + 1; --j)
          now *= (long double)(m - j + 1) / (long double)(1.00 * j);
        now /= (long double)(m - k);
        ans += now;
      }
  }
  ans /= (long double)n;
  cout << fixed << setprecision(15) << ans << endl;
  return 0;
}
