#include <bits/stdc++.h>
using namespace std;
int n, dcount[1024], nsep[1048576], slen;
double expect[1048576];
long long indist[1048576];
string s[50];
int main() {
  cin.sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < 1024; i++)
    for (int j = 0; j < 10; j++)
      if ((i & (1 << j)) == 0) dcount[i + (1 << j)] = dcount[i] + 1;
  if (n == 1) {
    cout << fixed << setprecision(11) << 0.0 << '\n';
    return 0;
  }
  for (int i = 0; i < n; i++) cin >> s[i];
  slen = s[0].size();
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int iseppos = 0;
      for (int k = 0; k < slen; k++)
        if (s[i][k] == s[j][k]) iseppos += (1 << k);
      indist[iseppos] |= (1LL << i);
    }
  for (int i = (1 << slen) - 1; i >= 0; i--) {
    long long cval = indist[i];
    for (int j = 0; j < slen; j++)
      if (((1LL << j) & i) != 0) indist[i - (1LL << j)] |= cval;
    int cindist = 0;
    for (int j = 0; j < 50; j += 10)
      cindist += dcount[(cval >> j) % (1LL << 10)];
    nsep[i] = n - cindist;
  }
  for (int i = (1 << slen) - 1; i >= 0; i--) {
    int ntodist = n - nsep[i], canpick = 0;
    for (int j = 0; j < slen; j++)
      if ((i & (1 << j)) == 0) canpick++;
    for (int j = 0; j < slen; j++)
      if ((i & (1 << j)) == 0) {
        int next = i + (1 << j);
        int candist = nsep[next] - nsep[i];
        if (ntodist > 0)
          expect[i] += 1.0 / canpick *
                       (1 + 1.0 * (ntodist - candist) / ntodist * expect[next]);
      }
  }
  cout << fixed << setprecision(11) << expect[0] << '\n';
  return 0;
}
