#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 s(n); rep(i, n) cin >> s[i]; int ans = 0; rep(i, n) { bool ok1 = true; bool ok2 = false; rep(j, m) { if (s[i][j] == 'o') { ok2 = true; int c = 0; rep(k, n) { if (s[k][j] == 'o') c++; } if (c != 1) ok1 = false; } } if (ok1 && ok2) ans++; } cout << ans << endl; return 0; }