#include <bits/stdc++.h>
using namespace std;
const int nmax = 50;
const int lmax = 20;
int n, m;
double p[lmax + 1];
bitset<nmax + 1> unic[1 << lmax];
char s[nmax + 1][lmax + 1];
int main() {
  fscanf(stdin, "%d", &n);
  for (int i = 0; i < n; ++i) fscanf(stdin, "%s", s[i]);
  m = strlen(s[0]);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      int st = 0;
      for (int k = 0; k < m; ++k)
        if (s[i][k] == s[j][k]) st += (1 << k);
      unic[st][i] = unic[st][j] = 1;
    }
  }
  for (int i = (1 << m) - 2; i >= 0; --i) {
    for (int j = 0; j < m; ++j) {
      if ((i & (1 << j)) == 0) unic[i] |= unic[i + (1 << j)];
    }
  }
  for (int i = 0; i < (1 << m); ++i)
    for (int j = 0; j < m; ++j) unic[i][j] = !unic[i][j];
  p[0] = 1;
  for (int i = 1; i <= m; ++i) {
    p[i] = p[i - 1] * i / (m - i + 1);
  }
  double ans = 0;
  for (int i = 0; i < (1 << m) - 1; ++i) {
    int zerouri = 0;
    for (int j = 0; j < m; ++j) {
      if ((i & (1 << j)) == 0) {
        ++zerouri;
      }
    }
    for (int j = 0; j < m; ++j) {
      if ((i & (1 << j)) == 0) {
        ans += (unic[i + (1 << j)] ^ unic[i]).count() * (m - zerouri + 1) *
               p[m - zerouri] / zerouri / n;
      }
    }
  }
  fprintf(stdout, "%.12lf\n", ans);
  return 0;
}
