#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int size = 60;
const int ssize = 20;
const int lsize = 20 * 1000;
char field[size][size];
int n, m;
int cnt[1 << ssize];
double ans[1 << ssize];
int clr[size][size];
int hmas[lsize];
int bc(int msk) {
  int c = 0;
  while (msk > 0) {
    c += msk & 1;
    msk /= 2;
  }
  return c;
}
int h[size];
int ch[size];
void rec(int ps, int msk) {
  if (ps == m) {
    cnt[msk] = 0;
    for (int i = 0; i < n; i++) ch[i] = 0;
    for (int i = 0; i < n; i++) {
      if (ch[clr[ps][i]] > 0) {
        cnt[msk]++;
      }
      ch[clr[ps][i]]++;
      if (ch[clr[ps][i]] == 2) cnt[msk]++;
    }
    return;
  }
  for (int i = 0; i < n; i++) clr[ps + 1][i] = clr[ps][i];
  rec(ps + 1, msk);
  for (int i = 0; i < n; i++) {
    clr[ps + 1][i] = clr[ps][i] * 200 + (int)field[i][ps];
    hmas[clr[ps + 1][i]] = -1;
  }
  int cc = 0;
  for (int i = 0; i < n; i++) {
    if (hmas[clr[ps + 1][i]] == -1) {
      hmas[clr[ps + 1][i]] = cc++;
    }
    clr[ps + 1][i] = hmas[clr[ps + 1][i]];
  }
  rec(ps + 1, msk | (1 << ps));
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", field[i]);
  }
  m = strlen(field[0]);
  for (int i = 0; i < n; i++) clr[0][i] = 0;
  rec(0, 0);
  for (int i = (1 << m) - 1; i >= 0; i--) {
    if (cnt[i] == 0)
      ans[i] = 0.0;
    else {
      ans[i] = 0.0;
      double p = 1.0 / (m - bc(i));
      for (int j = 0; j < m; j++)
        if (!((i >> j) & 1)) {
          int tg = i | (1 << j);
          double g = (cnt[i] - cnt[tg] + 0.0) / cnt[i];
          ans[i] += p * (g + (1 - g) * (ans[tg] + 1));
        }
    }
  }
  cout.precision(20);
  cout << ans[0] << endl;
  return 0;
}
