#include <bits/stdc++.h>
using namespace std;
const int MAXN = 52;
const int MAXL = 21;
int n, l;
char s[MAXN][MAXL];
long long d[1 << 20];
double dfs(int x, int num, double expr, int mask) {
  if (num == l) return 0.0;
  if (x == l) {
    return expr * __builtin_popcountll(d[mask]);
  }
  double ans = dfs(x + 1, num, expr, mask);
  return ans +
         dfs(x + 1, num + 1, expr / (l - num) * (num + 1), mask | (1 << x));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i]);
  }
  l = strlen(s[1]);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      int mask = 0;
      for (int k = 0; k < l; ++k) {
        if ((s[i][k] == s[j][k])) mask |= 1 << k;
      }
      d[mask] |= (1LL << i) | (1LL << j);
    }
  }
  for (int i = 0; i < l; ++i) {
    for (int mask = 1 << i; mask < 1 << l; ++mask) {
      if (mask >> i & 1) d[mask ^ (1 << i)] |= d[mask];
    }
  }
  printf("%.10lf\n", dfs(0, 0, 1, 0) / n);
  return 0;
}
