#include <bits/stdc++.h>
using namespace std;
char s[60][30];
long long id[1 << 20];
int num[1 << 20];
double f[1 << 20];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf(" %s", &s[i]);
  }
  int m = strlen(s[1]);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int mask = 0;
      for (int k = 0; k < m; k++) {
        mask |= s[i][k] == s[j][k] ? (1ll << k) : 0;
      }
      id[mask] |= (1ll << i) | (1ll << j);
    }
  }
  for (int mask = (1 << m) - 1; mask >= 0; mask--) {
    for (int i = 0; i < m; i++) {
      if ((mask >> i) & 1) {
        id[mask ^ (1 << i)] |= id[mask];
      }
    }
  }
  for (int i = 0; i <= (1 << m) - 1; i++) {
    long long tmp = id[i];
    int ans = 0;
    while (tmp) {
      ans += tmp & 1;
      tmp >>= 1;
    }
    num[i] = ans;
    if (num[i] == 1) num[i] = 0;
  }
  f[(1 << m) - 1] = 0;
  for (int s = (1 << m) - 2; s >= 0; s--) {
    if (!num[s]) {
      f[s] = 0;
      continue;
    }
    int tot = 0;
    for (int i = 0; i < m; i++)
      if (!(s & (1 << i))) tot++;
    for (int i = 0; i < m; i++) {
      if (((1 << i) & s)) continue;
      f[s] += (1.0 * f[s | (1 << i)] / (double)tot * (double)num[s | (1 << i)] /
               (double)num[s]);
    }
    f[s] += 1.0;
  }
  printf("%.10lf", f[0]);
  return 0;
}
