#include <bits/stdc++.h>
using namespace std;
template <class T, class L>
bool smax(T &x, L y) {
  return x < y ? (x = y, 1) : 0;
}
template <class T, class L>
bool smin(T &x, L y) {
  return y < x ? (x = y, 1) : 0;
}
const int maxn = 50, maxm = 20;
int n, m, pm, c[maxm + 1][maxm + 1], bpc[1 << maxm], sz[1 << maxm],
    adj[1 << maxm][maxm];
string s[maxn];
bool seen[1 << maxm];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  if (n == 1) return cout << 0 << '\n', 0;
  for (int i = 0; i < n; i++) cin >> s[i];
  m = s[0].size();
  pm = 1 << m;
  c[0][0] = 1;
  for (int n = 1; n <= m; n++) {
    c[n][0] = c[n][n] = 1;
    for (int r = 1; r < n; r++) c[n][r] = c[n - 1][r] + c[n - 1][r - 1];
  }
  for (int mask = 0; mask < pm; mask++) bpc[mask] = __builtin_popcount(mask);
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    memset(seen, 0, sizeof seen);
    for (int j = 0; j < n; j++)
      if (i != j) {
        int mask = 0;
        for (int p = 0; p < m; p++)
          if (s[i][p] == s[j][p]) mask |= 1 << p;
        seen[mask] = 1;
      }
    for (int i = 0; i < m; i++)
      for (int mask = 0; mask < pm - 1; mask++)
        seen[mask] |= seen[mask | (1 << i)];
    ans += m;
    for (int mask = 1; mask < pm - 1; mask++)
      if (!seen[mask]) ans -= 1. / c[m][bpc[mask]];
  }
  cout << fixed << setprecision(17) << ans / n << '\n';
  return 0;
}
