#include #include using namespace std; #define rep(i,n) for(int i = 0; i < (int)(n); i++) using ll = long long; constexpr int inf = 1e9; signed main() { int N,M; cin >> N >> M; vector S(N); rep(i,N) cin >> S[i]; assert(N <= 6); vector per(N); ranges::iota(per,0); ll cnt = 0; do { string p; rep(i,M) p.push_back('o'); rep(i,N) { rep(j,N) { if (S[per[i]][j] == 'x') p[j] = 'x'; } if (ranges::count(p,'o') == 1) { cnt += i + 1; break; } } }while (ranges::next_permutation(per).found); ll div = 1; for (int i = 1; i <= N; i++) div *= i; cout << fixed << setprecision(10) << static_cast(cnt) / static_cast(div) << endl; }