#include <bits/stdc++.h>
using namespace std;
int n, l;
char s[100][100];
double dp[(1 << 20)];
long long int dm[(1 << 20)];
int lg[(1 << 20)];
int cb[(1 << 20)];
int cnt(long long int k) {
  if (k >> 20) {
    return cb[k & ((1 << 20) - 1)] + cnt(k >> 20);
  }
  return cb[k & ((1 << 20) - 1)];
}
void sol() {
  memset(dm, 0, sizeof(dm));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (l = 0; s[0][l]; l++)
    ;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int m = 0;
      for (int k = 0; k < l; k++) {
        m += ((s[i][k] == s[j][k]) << k);
      }
      dm[m] |= (1ll << i) | (1ll << j);
    }
  }
  for (int i = (1 << l) - 1; i >= 1; i--) {
    for (int k = 0; k < l; k++) {
      if (i & (1 << k)) {
        dm[i - (1 << k)] |= dm[i];
      }
    }
  }
  dp[(1 << l) - 1] = 0;
  for (int c = (1 << l) - 2; c >= 0; c--) {
    dp[c] = 0;
    if (dm[c] == 0) continue;
    for (int i = 0; i < l; i++) {
      if (c & (1 << i)) continue;
      dp[c] += dp[c + (1 << i)] * cnt(dm[c + (1 << i)]) / cnt(dm[c]);
    }
    dp[c] = dp[c] / (l - cnt(c)) + 1;
  }
  printf("%.10f\n", dp[0]);
}
int main() {
  cb[0] = 0;
  for (int i = 1; i < (1 << 20); i++) {
    cb[i] = cb[i - (i & -i)] + 1;
  }
  for (int i = 0; i < 20; i++) {
    lg[1 << i] = i;
  }
  while (1) {
    sol();
    break;
  }
  return 0;
}
