#include <bits/stdc++.h>
using namespace std;
const int MAXN = 20;
int n, m;
string s[50];
long long mask[1 << MAXN];
int f[1 << MAXN];
int cnt[1 << MAXN];
double c[55][55];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> s[i];
  m = s[0].length();
  c[0][0] = 1;
  for (int i = 1; i <= m; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  memset(cnt, 0, sizeof(cnt));
  for (int i = 1; i < (1 << m); ++i) {
    for (int j = 0; j < m; ++j)
      if (i & (1 << j)) {
        cnt[i] = cnt[i ^ (1 << j)] + 1.0;
        break;
      }
  }
  memset(f, 0, sizeof(f));
  for (int i = 0; i < n; ++i) {
    memset(mask, 0, sizeof(mask));
    for (int j = 0; j < m; ++j) {
      for (int k = 0; k < n; ++k) {
        if (k == i) continue;
        if (s[k][j] == s[i][j]) mask[1 << j] |= (1LL << k);
      }
    }
    for (int j = 1; j < (1 << m); ++j) {
      if (cnt[j] == 1) continue;
      mask[j] = mask[j & (j - 1)] & mask[j - (j & (j - 1))];
    }
    for (int j = 1; j < (1 << m); ++j)
      if (!mask[j]) ++f[j];
  }
  double ans = 0;
  for (int i = 1; i < (1 << m); ++i) {
    for (int j = 0; j < m; ++j)
      if (i & (1 << j)) {
        ans += 1.0 / m / c[m - 1][cnt[i] - 1] * cnt[i] *
               (f[i] - f[i ^ (1 << j)]) / n;
      }
  }
  if (n == 1) ans = 0;
  printf("%.10lf\n", ans);
  return 0;
}
