#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int h, w; cin >> h >> w; vector A(h); vector cnt(w); for(auto &&s : A){ cin >> s; for(int x = 0; x < w; x++){ cnt[x] += s[x] == 'o'; } } int ans = 0; for(auto &&s : A){ bool flg = true, flg2 = false; for(int x = 0; x < w; x++){ if(s[x] == 'o' && cnt[x] >= 2){ flg = false; break; } if(s[x] == 'o') flg2 = true; } ans += (flg && flg2); } cout << ans << '\n'; }