#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[51][30];
long long int bin[60];
long long int dp[1 << 21];
double p[1 << 21];
long long int c[21];
int main() {
  bin[0] = 1;
  for (int i = 1; i <= 50; i++) {
    bin[i] = bin[i - 1] << 1;
  }
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  m = strlen(s[0]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j) {
        int same = 0;
        for (int k = 0; k < m; k++) {
          if (s[i][k] == s[j][k]) {
            same |= bin[k];
          }
        }
        dp[same] |= bin[i];
        dp[same] |= bin[j];
      }
    }
  }
  for (int i = bin[m] - 1; i > 0; i--) {
    for (int j = 0; j < m; j++) {
      if (i & bin[j]) {
        dp[i ^ bin[j]] |= dp[i];
      }
    }
  }
  c[0] = 1;
  for (int i = 1; i <= m; i++) {
    c[i] = c[i - 1] * (m - i + 1) / i;
  }
  double ans = 0;
  for (int i = 0; i < bin[m]; i++) {
    int z = 0;
    for (int j = 0; j < m; j++) {
      if (i & bin[j]) z++;
    }
    double cnt = 0;
    for (int j = 0; j < n; j++) {
      if (dp[i] & bin[j]) {
        cnt += 1.0;
      }
    }
    ans += cnt / (double)c[z];
  }
  ans = ans / (double)n;
  printf("%.11lf\n", ans);
}
