#include <bits/stdc++.h>
using namespace std;
const int maxN = 55;
const int maxLen = 20;
int cnt[1 << maxLen];
double mfact[maxN];
long long msk[1 << maxLen];
long long f[maxN];
int n;
string s[maxN];
int main() {
  for (int i = 0; i < (1 << maxLen); ++i) {
    cnt[i] = bitset<23>(i).count();
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  int m = s[0].length();
  mfact[0] = 1;
  for (int i = 1;; ++i) {
    if (m - i + 1 == 0) {
      break;
    }
    mfact[i] = 1. / (m - i + 1.) * mfact[i - 1];
  }
  for (int i = 0; i <= 20; ++i) {
    mfact[i] *= i;
  }
  double res = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      long long cmask = 0;
      for (int k = 0; k < m; ++k) {
        if (s[i][k] == s[j][k]) {
          cmask += (1LL << k);
        }
      }
      msk[cmask] |= (1LL << i);
      msk[cmask] |= (1LL << j);
    }
  }
  for (int i = (1 << m) - 1; i >= 0; --i) {
    for (int j = 0; j < m; ++j) {
      if (i & (1 << j)) {
        msk[i - (1 << j)] |= msk[i];
      }
    }
  }
  f[0] = 1;
  for (int i = 1; i < maxN; ++i) {
    f[i] = f[i - 1] * i;
  }
  for (int i = (1 << m) - 1; i >= 0; --i) {
    if (!msk[i]) {
      continue;
    }
    for (int j = 0; j < m; ++j) {
      if (!(i & (1 << j))) {
        bitset<55> b = msk[i] - msk[i + (1 << j)];
        res += mfact[cnt[i + (1 << j)]] * b.count() * f[cnt[i]];
      }
    }
  }
  printf("%.10lf\n", res / n);
  return 0;
}
