#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50;
const int MAXM = 20;
const int MAXMM = 1 << MAXM;
double dp[MAXMM];
bitset<MAXN> differ[MAXMM];
int n, m;
string strs[MAXN];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> strs[i];
  }
  m = strs[0].size();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      bitset<MAXM> same(0);
      if (i == j) {
        continue;
      }
      for (int k = 0; k < m; k++) {
        if (strs[i][k] == strs[j][k]) {
          same.set(k);
        }
      }
      differ[same.to_ulong()].set(i);
    }
  }
  for (int i = (1 << m) - 1; i >= 0; i--) {
    bitset<MAXM> b(i);
    for (int j = 0; j < m; j++) {
      if (b[j]) {
        b.reset(j);
        differ[b.to_ulong()] |= differ[i];
        b.set(j);
      }
    }
  }
  for (int i = (1 << m) - 1; i >= 0; i--) {
    bitset<MAXM> b(i);
    if (differ[i].count() == 0) {
      continue;
    }
    dp[i]++;
    double choice = m - b.count();
    for (int j = 0; j < m; j++) {
      if (b[j] == 0) {
        b.set(j);
        double pro = double(differ[b.to_ulong()].count()) / differ[i].count();
        dp[i] += dp[b.to_ulong()] / choice * pro;
        b.reset(j);
      }
    }
  }
  cout << setiosflags(ios::fixed) << setprecision(9) << dp[0] << endl;
  cin.get();
  cin.get();
  return 0;
}
