#include <bits/stdc++.h>
using namespace std;
const int N = 20;
const int MAXN = 1E7;
const int MOD = 1000000007;
int i, j, k, n, m, cnt, diffCnt;
int bitCnt[1 << N];
long long diff, eq[1 << N];
double res, ans, prob[51];
string s[51];
int getBitCnt(long long v) {
  int res = 0;
  long long ALL = (1 << N) - 1;
  for (int i = 0; i < 3; i++) {
    res += bitCnt[(v >> (i * N)) & ALL];
  }
  return res;
}
int getBitCntX(long long v) {
  int res = 0;
  for (int i = 0; i < 52; i++) {
    if (v & (1LL << i)) res++;
  }
  return res;
}
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s[i];
  }
  m = s[0].size();
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      int mask = 0;
      for (k = 0; k < m; k++) {
        if (s[i][k] == s[j][k]) mask |= 1 << k;
      }
      eq[mask] |= 1LL << i;
      eq[mask] |= 1LL << j;
    }
  }
  for (i = (1 << m) - 1; i >= 0; i--) {
    for (j = 0; j < m; j++) {
      if (i & (1 << j)) {
        eq[i ^ (1 << j)] |= eq[i];
      }
    }
  }
  bitCnt[0] = 0;
  for (i = 1; i < (1 << N); i++) {
    bitCnt[i] = bitCnt[i & (i - 1)] + 1;
  }
  prob[0] = 1.0;
  for (i = 1; i <= m; i++) {
    prob[i] = prob[i - 1] / (m + 1 - i);
    if (i > 1) prob[i] *= i - 1;
  }
  for (i = 0; i < (1 << m); i++) {
    for (j = 0; j < m; j++) {
      if (i & (1 << j)) continue;
      cnt = bitCnt[i] + 1;
      diff = eq[i] ^ eq[i ^ (1 << j)];
      diffCnt = getBitCnt(diff);
      ans += prob[cnt] * diffCnt * cnt;
    }
  }
  printf("%.15lf\n", ans / n);
  return 0;
}
