#include <bits/stdc++.h>
using namespace std;
int n, m;
string s[64];
long long mask[32][256], dp[1024 * 1024];
int cnt[1024 * 1024];
double pr[1024 * 1024];
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  m = (int)(s[0].size());
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      mask[i][s[j][i]] |= (1LL << j);
    }
  }
  for (int i = 0; i < n; ++i) {
    dp[0] = (1LL << n) - 1LL;
    if (dp[0] == (1LL << i)) {
      cnt[0]++;
    }
    for (int b = 0; b < m; ++b) {
      for (int j = (1 << b); j < (1 << (b + 1)); ++j) {
        dp[j] = dp[j ^ (1 << b)] & mask[b][s[i][b]];
        if (dp[j] == (1LL << i)) {
          cnt[j]++;
        }
      }
    }
  }
  pr[0] = 1.0;
  double ans = 0.0;
  for (int i = 0; i < (1 << m); ++i) {
    for (int j = 0; j < m; ++j)
      if (i & (1 << j))
        if (cnt[i ^ (1 << j)] != n) {
          pr[i] += pr[i ^ (1 << j)] / double(m - __builtin_popcount(i) + 1);
        }
    ans += pr[i] * double(n - cnt[i]);
  }
  cout << fixed << setprecision(15) << ans / double(n) << endl;
  return 0;
}
