#include using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); ++i) int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int N, M; cin >> N >> M; vector S(N); rep(i, N) cin >> S[i]; double ans = 0; vector dp(1 << N, 0); dp[0] = 1; rep(bit, 1 << N) { vector vec(M, 1); rep(i, N) if(bit >> i & 1) rep(j, M) if(S[i][j] == 'x') vec[j] = 0; int cnt = 0; rep(i, M) if(vec[i]) cnt += 1; if(cnt == 1) { ans += __builtin_popcount(bit) * dp[bit]; continue; } dp[bit] /= (N - __builtin_popcount(bit)); rep(i, N) { if(bit >> i & 1) continue; dp[bit | (1 << i)] += dp[bit]; } } cout << fixed << setprecision(15) << ans << "\n"; }