#include <bits/stdc++.h>
using namespace std;
string my[50];
long long d[1 << 20];
double dp[1 << 20];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (auto i = 0; i < (n); i++) cin >> my[i];
  int m = ((int)my[0].size());
  for (auto i = 0; i < (n); i++) {
    for (auto j = 0; j < (n); j++) {
      if (i == j) continue;
      int mask = 0;
      for (auto k = 0; k < (m); k++)
        if (my[i][k] == my[j][k]) mask += (1 << k);
      d[mask] |= (1ll << i);
    }
  }
  for (int mask = (1 << m) - 1; mask >= 0; mask--) {
    for (auto j = 0; j < (m); j++)
      if (mask & (1 << j)) d[mask ^ (1 << j)] |= d[mask];
    if (!d[mask]) continue;
    double down = __builtin_popcountll(d[mask]);
    for (auto j = 0; j < (m); j++) {
      if (mask & (1 << j)) continue;
      double up = __builtin_popcountll(d[mask | (1 << j)]);
      dp[mask] += dp[mask | (1 << j)] * (up / down);
    }
    dp[mask] /= m - __builtin_popcount(mask);
    dp[mask]++;
  }
  cout << fixed << setprecision(11) << dp[0] << endl;
  return 0;
}
