#include <bits/stdc++.h>
void Init();
void PreProcess();
int countBit(long long x);
int n, len;
char str[(60)][(20) + 10];
double f[1 << (20)];
long long p[1 << (20)];
int main() {
  Init();
  PreProcess();
  int final = (1 << len) - 1;
  for (int i = final; i >= 0; i--) {
    int bit = countBit((long long)i);
    if (len - bit) {
      f[i] /= len - bit;
    }
    f[i] += countBit(p[i]) * 1.0 / n;
    for (int k = 0; k < len; k++) {
      int v = 1 << k;
      if (i & v) {
        f[i ^ v] += f[i];
        p[i ^ v] |= p[i];
      }
    }
  }
  printf("%.10lf\n", f[0]);
  return 0;
}
int countBit(long long x) {
  int res = 0;
  while (x) {
    res += (int)(x & 1);
    x >>= 1;
  }
  return res;
}
void PreProcess() {
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      int v = 0;
      for (int k = 0; k < len; k++) {
        if (str[i][k] == str[j][k]) {
          v |= 1 << k;
        }
      }
      p[v] |= 1LL << i;
      p[v] |= 1LL << j;
    }
  }
}
void Init() {
  memset(f, 0x00, sizeof(f));
  memset(p, 0x00, sizeof(p));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &str[i]);
  }
  len = strlen(str[0]);
}
