#include <bits/stdc++.h>
using namespace std;
const long long maxn = (1 << 20) + 5;
char op[55][25];
long long same[maxn];
int cnt[maxn];
double dp[maxn];
int main() {
  int n;
  scanf("%d", &n);
  memset(cnt, 0, sizeof(cnt));
  memset(same, 0, sizeof(same));
  for (int i = 0; i < n; i++) {
    scanf("%s", op[i]);
  }
  if (n == 1) {
    puts("0.000000000000000");
    return 0;
  }
  int len = strlen(op[1]);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      long long mask = 0;
      for (int k = 0; k < len; k++) {
        if (op[i][k] == op[j][k]) {
          mask |= (1LL << k);
        }
      }
      same[mask] |= (1LL << i);
      same[mask] |= (1LL << j);
    }
  }
  long long mx = (1LL << len) - 1;
  for (long long mask = mx; mask >= 1; mask--) {
    for (int i = 0; i < len; i++) {
      if (mask & (1LL << i)) {
        same[mask ^ (1LL << i)] |= same[mask];
      }
    }
  }
  for (long long mask = 0; mask <= mx; mask++) {
    for (int i = 0; i < n; i++) {
      if (same[mask] & (1LL << i)) {
        cnt[mask]++;
      }
    }
  }
  dp[mx] = 0.0;
  int tmp;
  for (long long mask = mx - 1; mask >= 0; mask--) {
    if (!cnt[mask]) {
      dp[mask] = 0.0;
      continue;
    } else {
      tmp = 0;
      for (int i = 0; i < len; i++) {
        if (!(mask & (1LL << i))) tmp++;
      }
      for (int i = 0; i < len; i++) {
        if (!(mask & (1LL << i))) {
          dp[mask] += dp[mask | (1LL << i)] / (1.0 * tmp) *
                      (1.0 * cnt[mask | (1LL << i)]) / (1.0 * cnt[mask]);
        }
      }
      dp[mask] += 1.0;
    }
  }
  printf("%.15lf", dp[0]);
  return 0;
}
