#include <bits/stdc++.h>
using namespace std;
int n;
long long c[25][25];
long long dp[2500005];
int eq[55][55];
char buf[25];
string s[55];
int S[25];
int main() {
  scanf(" %d", &n);
  for (int i = 0; i <= 20; i++)
    for (int j = 0; j <= i; j++)
      if (j == 0 || j == i)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]);
  for (int i = 0; i < n; i++) {
    scanf(" %s", buf);
    s[i] = (string)buf;
  }
  int m = s[0].size();
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < m; k++)
        if (s[i][k] == s[j][k]) eq[i][j] += (1ll << (k));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j) dp[eq[i][j]] |= (1ll << (i));
  for (int i = (1ll << (m)) - 1; i >= 0; i--)
    for (int j = 0; j < m; j++)
      if (i & (1ll << (j))) dp[i - (1ll << (j))] |= dp[i];
  long double ans = 0;
  for (int i = 0; i < (1ll << (m)); i++) {
    int t = 0;
    long long q = (1ll << (m)) - 1 - i;
    for (int j = 0; j < n; j++)
      if (dp[q] & (1ll << (j))) t++;
    int sz = 0;
    for (int j = 0; j < m; j++)
      if (i & (1ll << (j))) sz++;
    S[sz] += t;
  }
  for (int i = 0; i <= m; i++) {
    ans += S[i] / (long double)1. / c[m][i];
  }
  ans /= n;
  printf("%.12lf\n", (double)ans);
  return 0;
}
