#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n, m; cin >> n >> m; vector a(n, 0); rep(i, n) { string s; cin >> s; rep(j, m) { if (s[j] == 'o') a[i] += 1LL << j; } } vector dp(1 << n, -1); function rec = [&](int i) { ll x = (1LL << 60) - 1; if (dp[i] != -1) return dp[i]; rep(j, n) { if (i >> j & 1) { x &= a[j]; } } int bi = 0; rep(j, m) if (x >> j & 1) bi++; if (bi == 1) { return dp[i] = 0; } int cnt = 0; double ans = 0; rep(j, n) { if (i >> j & 1) continue; ans += rec(i ^ 1 << j); cnt++; } return dp[i] = ans / cnt + 1; }; cout << fixed << setprecision(12); cout << rec(0) << endl; return 0; }