#include <bits/stdc++.h>
using namespace std;
char a[55][25];
int n, m;
long long Q[1 << 20];
double dfs(int x, int num, double pro, int mask) {
  if (num == m) return 0.0;
  if (x == m) {
    int r = __builtin_popcountll(Q[mask]);
    return r * pro;
  }
  double ans = dfs(x + 1, num, pro, mask);
  ans += dfs(x + 1, num + 1, pro / (m - num) * (num + 1), mask | (1 << x));
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%s", a[i]);
  m = strlen(a[1]);
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j) {
      int mask = 0;
      for (int k = 0; k < m; ++k)
        if (a[i][k] == a[j][k]) mask |= 1 << k;
      Q[mask] |= (1LL << i) | (1LL << j);
    }
  for (int i = 0; i < m; ++i)
    for (int mask = 1 << i; mask < 1 << m; ++mask)
      if (mask >> i & 1) Q[mask ^ (1 << i)] |= Q[mask];
  printf("%.10f\n", dfs(0, 0, 1, 0) / n);
  return 0;
}
