#include <bits/stdc++.h>
using namespace std;
long long c[111][111];
int main() {
  int n;
  scanf("%d\n", &n);
  string s[n];
  if (n == 1) {
    printf("0");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    getline(cin, s[i]);
  }
  int m = s[0].length();
  vector<long long> same(1 << m);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int mask = 0;
      for (int p = 0; p < m; p++)
        if (s[i][p] == s[j][p]) {
          mask |= 1 << p;
        }
      same[mask] |= 1ll << i | 1ll << j;
    }
  for (int i = (1 << m) - 1; i; i--)
    for (int j = 0; j < m; j++)
      if (i & (1 << j)) {
        same[i ^ (1 << j)] |= same[i];
      }
  c[0][0] = 1;
  for (int i = 1; i < 111; i++)
    for (int j = 0; j < 111; j++) {
      c[i][j] = c[i - 1][j] + (j ? c[i - 1][j - 1] : 0);
    }
  double ans = 0;
  for (int i = 0; i < 1 << m; i++) {
    ans += (double)__builtin_popcountll(same[i]) / c[m][__builtin_popcount(i)];
  }
  printf("%.9lf", ans / n);
}
