#include <bits/stdc++.h>
using namespace std;
const int mult = 1528987;
const int N = 1050000;
int n, m;
char s[55][25];
int bt[N];
long long can[N];
double dp[N], ans;
int popcount(long long x) {
  long long MOD = 1ll << 32;
  return __builtin_popcount(int(x / MOD)) + __builtin_popcount(int(x % MOD));
}
int main() {
  for (int i = 1, j = 0; j <= 20; i *= 2, j++) bt[i] = j;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%s", s[i]);
  m = strlen(s[1]);
  dp[0] = 1.0;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      int msk = 0;
      for (int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) msk |= 1 << k;
      can[msk] |= 1ll << (i - 1);
      can[msk] |= 1ll << (j - 1);
    }
  dp[0] = 1.0;
  for (int i = (1 << m) - 1; i > 0; i--)
    for (int j = 0; j < m; j++)
      if (i & (1 << j)) can[i ^ (1 << j)] |= can[i];
  for (int i = 0; i < (1 << m); i++)
    if (can[i] != 0ll)
      for (int j = 0; j < m; j++)
        if (~i & (1 << j)) {
          int t = __builtin_popcount(i);
          int ni = i ^ (1 << j);
          double f = 1.0 * popcount(can[ni]) / popcount(can[i]);
          dp[ni] += dp[i] / (m - t) * f;
          ans += dp[i] / (m - t) * (1.0 - f) * (t + 1);
        }
  printf("%.9f\n", ans);
  return 0;
}
