#include <bits/stdc++.h>
using namespace std;
int n, l;
char a[55][55];
long long masks[1 << 20];
long double dp[1 << 20];
inline int bc(long long x) { return __builtin_popcountll(x); }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", a[i]);
    l = strlen(a[i]);
    for (int j = 0; j < i; ++j) {
      int mask = 0;
      for (int k = 0; k < l; ++k) mask |= ((a[i][k] == a[j][k]) << k);
      masks[mask] |= (1LL << i) | (1LL << j);
    }
  }
  for (int i = (1 << l) - 1; i >= 0; --i) {
    for (int j = 0; j < l; ++j)
      if (i & (1 << j)) masks[i ^ (1 << j)] |= masks[i];
    int cnt = 0;
    for (int j = 0; j < l; ++j)
      if (!(i & (1 << j))) dp[i] += dp[i ^ (1 << j)], ++cnt;
    if (cnt > 0) dp[i] /= cnt;
    dp[i] += (long double)bc(masks[i]) / n;
  }
  printf("%.20lf\n", (double)dp[0]);
  return 0;
}
