#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 = false; for(int x = 0; x < w; x++){ if(s[x] == 'o' && cnt[x] == 1){ flg = true; break; } } ans += flg; } cout << ans << '\n'; }