#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
const char lf = '\n';
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
inline int ts(char *s) {
  int a = 0, c = fetch();
  while (c <= 32 && c != EOF) c = fetch();
  while (c > 32 && c != EOF) s[a++] = c, c = fetch();
  s[a] = 0;
  return a;
}
}  // namespace ae86
using ae86::ts;
using ae86::ty;
const int _ = 53, L = 20, _L = 1 << L;
int n, m, mm;
long long res[_L] = {0};
char s[_][L] = {0};
double f[_L] = {0}, ans = 0;
int main() {
  ios::sync_with_stdio(0), cout.tie(nullptr);
  n = ty();
  for (int i = 0; i < n; i++) m = ts(s[i]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int par = 0;
      for (int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) par += (1ll << (k));
      res[par] |= (1ll << (i)) | (1ll << (j));
    }
  mm = (1ll << (m));
  for (int i = mm - 1; i >= 0; i--)
    for (int j = 0; j < m; j++)
      if ((((i) >> (j)) & 1)) res[i - (1ll << (j))] |= res[i];
  f[0] = 1;
  for (int i = 0; i < mm; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) cnt += (((res[i]) >> (j)) & 1);
    ans += f[i] * cnt;
    cnt = 0;
    for (int j = 0; j < m; j++) cnt += (((i) >> (j)) & 1);
    for (int j = 0; j < m; j++)
      if (!(((i) >> (j)) & 1)) f[i + (1ll << (j))] += f[i] / (m - cnt);
  }
  cout << setprecision(11) << fixed << ans / n << lf;
  return 0;
}
