#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
const int MAXL = 20;
const unsigned int P = 7111;
int N, L, ok[1 << MAXL];
double dp[1 << MAXL];
unsigned int val[1 << MAXL][MAXN], hval[MAXL][MAXN];
string S[MAXN];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    L = S[i].size();
    unsigned int p = 1;
    for (int j = 0; j < L; j++) {
      hval[j][i] = p * S[i][j];
      p *= P;
    }
  }
  for (int i = 1; i < (1 << L); i++) {
    int k = __builtin_ffs(i) - 1, pk = (1 << k);
    for (int j = 0; j < N; j++) {
      val[i][j] = val[i ^ pk][j] + hval[k][j];
    }
  }
  for (int i = 0; i < (1 << L); i++) {
    sort(val[i], val[i] + N);
    bool a = 1, b;
    for (int j = 1; j < N; j++) {
      b = (val[i][j - 1] != val[i][j]);
      ok[i] += (a & b);
      a = b;
    }
    if (N > 1) {
      ok[i] += (val[i][N - 2] != val[i][N - 1]);
    }
  }
  for (int i = (1 << L) - 1; i >= 0; i--) {
    dp[i] = N - ok[i];
    int k = L - __builtin_popcount(i);
    for (int j = 0; j < L; j++) {
      if (i & (1 << j)) continue;
      dp[i] += dp[i ^ (1 << j)] / k;
    }
  }
  cout << fixed << setprecision(9);
  cout << (N == 1 ? 0 : dp[0] / N) << '\n';
}
