#include <bits/stdc++.h>
using namespace std;
char s[55][22];
int ans[22], n, m, cnt[1 << 20];
long long dp[1 << 20];
int cal(long long x) {
  int ret = 0;
  while (x) {
    ret += x & 1;
    x >>= 1;
  }
  return ret;
}
int main() {
  cnt[0] = 0;
  for (int i = 1; i < (1 << 20); i++) {
    cnt[i] = 1 + cnt[i - (i & -i)];
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  m = strlen(s[0]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int same = 0;
      for (int k = 0; k < m; k++) {
        if (s[i][k] == s[j][k]) same |= 1 << k;
      }
      dp[same] |= 1LL << i;
    }
  }
  for (int i = (1 << m) - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      if ((i & (1 << j)) == 0) {
        dp[i] |= dp[i | (1 << j)];
      }
    }
  }
  for (int i = 0; i < (1 << m); i++) {
    for (int j = 0; j < m; j++) {
      if ((i & (1 << j)) == 0) {
        long long tmp = dp[i] ^ dp[i | (1 << j)];
        if (tmp == 0) continue;
        ans[cnt[i] + 1] += cal(tmp);
      }
    }
  }
  long double ret = 0;
  for (int i = 1; i <= m; i++) {
    long double tmp = 1;
    for (int j = 1; j <= i; j++) {
      tmp *= 1.0 * j / (m - j + 1);
    }
    tmp *= ans[i];
    ret += tmp;
  }
  ret /= n;
  cout << fixed << setprecision(15) << ret << endl;
  return 0;
}
