#include <bits/stdc++.h>
using namespace std;
const int nsz = 50, msz = 20, msksz = (1 << msz) - 1;
int n, m, full;
long long dat[msksz + 5];
double dp[msksz + 5], sum[msksz + 5], ans;
string s[nsz + 5];
int inline count_bits(long long S) { return __builtin_popcountll(S); }
string inline bin(int S, int len = m) {
  string s;
  for (int i = 0; i < len; ++i) {
    s += (S >> i & 1) + 48;
  }
  return s;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  m = (int)s[0].size();
  full = (1 << m) - 1;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j <= n - 1; ++j) {
      int S = 0;
      for (int k = 0; k < m; ++k) {
        S |= (s[i][k] == s[j][k]) << k;
      }
      dat[S] |= (1LL << i) | (1LL << j);
    }
  }
  for (int S = full; S >= 0; --S) {
    for (int t = S, d = t & -t; d; t -= d, d = t & -t) {
      int nS = S ^ d;
      dat[nS] |= dat[S];
    }
  }
  dp[0] = 1;
  for (int S = 0; S <= full; ++S) {
    double val = dp[S] / (m - count_bits(S));
    for (int t = S ^ full, d = t & -t; d; t -= d, d = t & -t) {
      dp[S | d] += val;
    }
    for (int i = 0; i < n; ++i) {
      if (!(dat[S] >> i & 1)) continue;
      ans += dp[S];
    }
  }
  ans /= n;
  cout << fixed << setprecision(12) << ans << '\n';
}
