#include <bits/stdc++.h>
using namespace std;
char str[50][25];
long long same[(1 << 20) + 1];
double c[21][21];
double f[(1 << 20) + 1];
int one(long long x) {
  int res = 0;
  for (; x > 0; x >>= 1) {
    if (x & 1) ++res;
  }
  return res;
}
double solve(int n) {
  int m = strlen(str[0]);
  for (int i = 0; i <= m; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i != j) {
        int now = 0;
        for (int k = 0; k < m; ++k)
          if (str[i][k] == str[j][k]) now |= (1 << k);
        same[now] |= (1LL << i);
      }
    }
  }
  double res = 0;
  for (int i = (1 << m) - 2; i >= 0; --i) {
    for (int j = 0; j < m; ++j) {
      if ((i & (1 << j)) == 0) same[i] |= same[i | (1 << j)];
    }
    if (same[i] == 0) continue;
    res += 1.0 * one(same[i]) / n / c[m][one(i)];
  }
  printf("%.15f\n", res);
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%s", str[i]);
  solve(n);
  return 0;
}
