#include <bits/stdc++.h>
using namespace std;
const int N = 55;
char str[N][22];
long long a[1 << 21];
double dp[1 << 21];
template <class T>
int getone(T x) {
  int cnt = 0;
  while (x) {
    x &= (x - 1);
    cnt++;
  }
  return cnt;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", str[i]);
  int len = strlen(str[0]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int temp = 0;
      for (int k = 0; k < len; k++)
        if (str[i][k] == str[j][k]) temp |= (1 << k);
      a[temp] |= (1LL << i) | (1LL << j);
    }
  int S = 1 << len;
  for (int s = S - 1; s >= 0; s--)
    for (int i = 0; i < len; i++)
      if (s >> i & 1) a[s ^ (1 << i)] |= a[s];
  dp[0] = 1;
  double ans = 0;
  for (int s = 0; s < S; s++) {
    int cnt = getone(s);
    for (int i = 0; i < len; i++) {
      if (s >> i & 1) continue;
      dp[s ^ (1 << i)] += dp[s] / (len - cnt);
    }
    cnt = getone(a[s]);
    ans += dp[s] * cnt / n;
  }
  printf("%.11f\n", ans);
  return 0;
}
