#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const long long int INFLL = 1e18 + 10;
const long double EPS = 1e-8;
const long double EPSLD = 1e-14;
const long long int MOD = 1e9 + 7;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
const int MAX_N = 1 << 21;
int n;
char cs[64][32];
string s[64];
long long int a[MAX_N];
long long int b[64];
long double ans;
int main() {
  scanf("%d", &n);
  for (int i = (0); i < (int)(n); i++) scanf("%s", cs[i]);
  for (int i = (0); i < (int)(n); i++) s[i] = cs[i];
  int m = s[0].length();
  for (int i = (0); i < (int)(n); i++) {
    for (int j = (0); j < (int)(i); j++) {
      long long int f = 0;
      for (int k = (0); k < (int)(m); k++)
        if (s[i][k] == s[j][k]) f |= (1ll << (k));
      a[f] |= (1ll << (i)) | (1ll << (j));
    }
  }
  for (int i = (0); i < (int)(m); i++)
    for (int j = (0); j < (int)((1ll << (m))); j++)
      if (!(j & (1ll << (i)))) a[j] |= a[j | (1ll << (i))];
  for (int i = (0); i < (int)((1ll << (m))); i++)
    b[__builtin_popcountll(i)] += __builtin_popcountll(a[i]);
  for (int i = (0); i < (int)(m); i++) {
    long double res = (long double)b[i] / (long double)n;
    for (int j = (0); j < (int)(i); j++)
      res *= (long double)(j + 1) / (long double)(m - j);
    ans += res;
  }
  printf("%.18lf\n", (double)ans);
  return 0;
}
