#include <bits/stdc++.h>
using namespace std;
double C(long long a, long long b) {
  double res = 1.0;
  for (long long i = a; i >= a - b + 1; i--) res *= i;
  for (long long i = 1; i <= b; i++) res /= (1.0 * i);
  return res;
}
long long pc(long long m) {
  long long res = 0;
  for (long long i = 0; i < 60; i++)
    if (m & (1ll << i)) res++;
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  long long n, m;
  cin >> n;
  vector<string> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  m = a[0].size();
  vector<long long> A((1 << m));
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      long long t = 0;
      for (long long k = 0; k < m; k++)
        if (a[i][k] == a[j][k]) t |= (1ll << k);
      A[t] |= (1ll << i);
      A[t] |= (1ll << j);
    }
  }
  for (long long mask = (1 << m) - 1; mask >= 0; mask--) {
    for (long long i = 0; i < m; i++) {
      if (mask & (1ll << i)) {
        A[mask ^ (1ll << i)] |= A[mask];
      }
    }
  }
  double res = 0.0;
  for (long long i = 0; i < (1ll << m); i++) {
    res += (pc(A[i]) * 1.0 / C(m, pc(i)) / n);
  }
  cout.precision(12);
  cout << fixed << res << '\n';
  return 0;
}
