#include <bits/stdc++.h>
using namespace std;
char str[55][22];
int n, m;
long long int d[(1 << 20) + 10];
double dp[(1 << 20) + 10];
int countb(long long int x) {
  int ans = 0;
  while (x) {
    ans++;
    x = x & (x - 1LL);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", str[i]);
  m = strlen(str[0]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      int same = 0;
      for (int k = 0; k < m; k++) {
        if (str[i][k] == str[j][k]) same |= (1 << k);
      }
      d[same] |= (1LL << i);
      d[same] |= (1LL << j);
    }
  }
  for (int mask = (1 << m) - 1; mask; mask--) {
    for (int j = 0; j < m; j++) {
      if ((mask >> j) & 1) {
        int nmask = mask ^ (1 << j);
        d[nmask] |= d[mask];
      }
    }
  }
  dp[0] = 1;
  double ans = 0;
  for (int mask = 0; mask < (1 << m); mask++) {
    int c = countb(mask);
    for (int j = 0; j < m; j++) {
      if (((mask >> j) & 1) == 0) {
        int nmask = mask | (1 << j);
        dp[nmask] += dp[mask] / (m - c);
      }
    }
    for (int j = 0; j < n; j++) {
      if ((d[mask] >> j) & 1LL) ans += dp[mask];
    }
  }
  printf("%.15lf\n", ans / n);
  return 0;
}
