#include <bits/stdc++.h>
using namespace std;
long long dp[(1 << 20)];
double venga[(1 << 20)];
int memo[(1 << 20)];
int contar(long long x) { return __builtin_popcountll(x) + 1; }
int main() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int m = s[0].length();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int mask = 0;
      for (int k = 0; k < m; k++) {
        if (s[i][k] == s[j][k]) mask |= (1 << k);
      }
      dp[mask] |= (1LL << i);
    }
  }
  for (int i = (1 << 20) - 1; i > 0; i--) {
    for (int k = 0; k < 20; k++) {
      int aux = 1 << k;
      if (i & aux) dp[i ^ aux] |= dp[i];
    }
  }
  double sol = 0;
  long long caca = 1;
  double prob[m + 1];
  prob[0] = 1;
  for (int i = 1; i < m; i++) {
    prob[i] = (prob[i - 1] * (double(i))) / double(m - i + 1);
  }
  for (int i = 0; i < m; i++) {
    prob[i] *= double(i + 1);
    prob[i] /= double(m - i);
  }
  for (int j = 0; j < (1 << m); j++) {
    int total = __builtin_popcount(j);
    int aux = 1;
    for (int k = 0; k < m; k++) {
      if (dp[j] != dp[j | aux]) {
        sol += prob[total] * double(contar(dp[j]) - contar(dp[j | aux]));
      }
      aux <<= 1;
    }
  }
  sol /= double(n);
  cout << setprecision(18) << fixed << sol << endl;
}
