#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 50 + 2, M = 20 + 2, S = 1 << 20, Z = 1e9 + 7, ms63 = 1061109567;
int n, m;
long long b[N];
char s[N][M];
long long amb[S];
double c[M][M];
double p[M];
void solve() {
  for (int i = 0; i <= 50; ++i) b[i] = 1ll << i;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      int sta = 0;
      for (int pos = 0; pos < m; ++pos)
        if (s[j][pos] == s[i][pos]) sta |= b[pos];
      amb[sta] |= b[i];
      amb[sta] |= b[j];
    }
  }
  int top = 1 << m;
  for (int sta = top; sta >= 0; --sta) {
    for (int i = 0; i < m; ++i)
      if (sta & b[i]) amb[sta ^ b[i]] |= amb[sta];
  }
  c[0][0] = 1;
  for (int i = 1; i <= m; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= m; ++j) {
      c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
    }
  }
  for (int i = 0; i < m; ++i) p[i] = 1.0 / c[m][i];
  double ans = 0;
  for (int sta = 0; sta < top; ++sta) {
    ans += __builtin_popcountll(amb[sta]) * p[__builtin_popcountll(sta)];
  }
  printf("%.15f\n", ans / n);
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; ++i) scanf("%s", s[i]);
    m = strlen(s[0]);
    solve();
  }
  return 0;
}
