#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, n, len, cnt1, cnt2;
  cin >> n;
  string s[n];
  for (i = 0; i < n; i++) cin >> s[i];
  len = s[0].length();
  long long num[(1 << len)], var, obt;
  long double moves[len + 1];
  fill(num, num + (1 << len), 0);
  fill(moves, moves + len + 1, 0);
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (i == j) continue;
      var = 0;
      for (k = 0; k < len; k++) {
        if (s[i][k] == s[j][k]) var += 1 << k;
      }
      num[var] |= (long long)1 << i;
    }
  }
  for (i = (1 << len) - 1; i >= 0; i--) {
    for (j = 0; j < len; j++) {
      if ((i >> j) & 1) {
        num[i ^ (1 << j)] |= num[i];
      }
    }
  }
  for (i = 0; i < (1 << len); i++) {
    cnt1 = __builtin_popcount(i);
    cnt1++;
    for (j = 0; j < len; j++) {
      if (!((i >> j) & 1)) {
        obt = num[i] ^ num[i | (1 << j)];
        cnt2 = __builtin_popcountll(obt);
        ;
        moves[cnt1] += (long double)cnt2;
      }
    }
  }
  long double exp, lc;
  exp = 0;
  for (i = 1; i <= len; i++) {
    lc = moves[i] * (long double)i;
    for (j = 0; j < i - 1; j++) {
      lc = lc * (long double)(i - j - 1) / (long double)(len - j);
    }
    lc = lc / (long double)(len - i + 1);
    exp += lc;
  }
  exp /= (long double)n;
  cout << fixed << setprecision(12) << exp << endl;
}
