#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 21;
double dp[maxn];
char c[52][25];
int cnt[maxn];
const int bit = 17;
int mm = (1 << 17) - 1;
int vis[maxn];
long long bad[maxn];
long long a[70];
int main() {
  int i, j, n, m;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%s", c[i]);
  }
  m = (int)strlen(c[0]);
  for (i = 1; i < (1 << 20); i++) {
    cnt[i] = cnt[i & (i - 1)] + 1;
  }
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      int f = 0;
      for (int w = 0; w < m; w++) {
        if (c[i][w] == c[j][w]) f = f | (1 << w);
      }
      bad[f] |= (long long)1 << i;
      bad[f] |= (long long)1 << j;
    }
  }
  int p = 1 << m;
  for (i = p - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      if (i & (1 << j)) {
        bad[i ^ (1 << j)] |= bad[i];
      }
    }
  }
  for (i = p - 1; i >= 0; i--) {
    for (j = 0; j < m; j++) {
      if (!(i & (1 << j))) {
        dp[i] += dp[i ^ (1 << j)];
      }
    }
    if (i != p - 1) dp[i] /= (m - cnt[i]);
    dp[i] += (cnt[(bad[i] & mm)] + cnt[(bad[i] >> bit) & mm] +
              cnt[bad[i] >> (2 * bit)]) *
             1.0 / n;
  }
  printf("%.10lf\n", dp[0]);
}
