#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char now[1 << 16], *S, *T;
  if (T == S) {
    T = (S = now) + fread(now, 1, 1 << 16, stdin);
    if (T == S) return EOF;
  }
  return *S++;
}
inline long long read() {
  register long long x = 0, f = 1;
  char ch = gc();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = gc();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = gc();
  }
  return (f == 1) ? x : -x;
}
long long num[2100001], cn[2100001], n, bit[2100001], m;
double f[2100001];
char s[101][101];
inline long long getbit(long long x) {
  long long ans = 0;
  while (x) {
    ans += (x & 1LL);
    x >>= 1LL;
  }
  return ans;
}
signed main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  m = strlen(s[0]);
  if (n == 1) {
    printf("%.9lf\n", 0.0);
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      long long zt = 0;
      for (long long k = 0; k < m; k++) {
        if (s[i][k] == s[j][k]) zt |= (1 << k);
      }
      cn[zt] |= (1LL << i) | (1LL << j);
    }
  }
  for (long long i = (1LL << m) - 1; i >= 0; i--) {
    for (long long j = 0; j < m; j++) {
      if (!((1LL << j) & i)) cn[i] |= cn[(1LL << j) ^ i];
    }
    num[i] = getbit(cn[i]);
  }
  for (long long i = 0; i < (1LL << m); i++)
    bit[i] = (bit[i >> 1LL] + (i & 1LL));
  for (long long i = (1LL << m) - 2; i >= 0; i--) {
    if (!num[i]) continue;
    for (long long j = 0; j < m; j++) {
      if (!((1LL << j) & i))
        f[i] += (f[(1LL << j) ^ i] / (double)(m - bit[i])) *
                ((double)num[(1LL << j) ^ i] / (double)num[i]);
    }
    f[i]++;
  }
  printf("%.9lf\n", f[0]);
  return 0;
}
