#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const double EPS = 1e-9;
const int INF = 1e9;
const long long INFLONG = (long long)1e18;
const int maxn = 55;
const int maxlen = 22;
int n;
char s[maxn][maxlen];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  int m = strlen(s[0]);
  vector<long long> dp(1 << m, 0);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int msk = 0;
      for (int it = 0; it < m; it++) msk ^= (s[i][it] == s[j][it]) * (1 << it);
      dp[msk] |= (1LL << i);
      dp[msk] |= (1LL << j);
    }
  for (int msk = (1 << m) - 1; msk >= 0; msk--)
    for (int bit = 0; bit < m; bit++)
      if ((msk >> bit) & 1) dp[msk ^ (1 << bit)] |= dp[msk];
  vector<int> ans(m + 1, 0);
  for (int msk = 0; msk < (1 << m); msk++) {
    for (int bit = 0; bit < m; bit++)
      if (((msk >> bit) & 1) == 0) {
        int nmsk = msk | (1 << bit);
        long long can = dp[msk] ^ dp[nmsk];
        ans[__builtin_popcount(msk) + 1] += __builtin_popcountll(can);
      }
  }
  double answer = 0;
  for (int i = 1; i <= m; i++) {
    double x = ans[i] * i;
    for (int j = 0; j < i - 1; j++) x *= (i - j - 1) * 1.0 / (m - j);
    answer += x / (m - i + 1);
  }
  printf("%.17lf\n", answer * 1.0 / n);
  return 0;
}
