#![allow(non_snake_case, unused_imports)] use std::cmp::{min, max}; use std::collections::{BinaryHeap, Bound, HashMap, HashSet, VecDeque}; use std::hash::Hash; use std::ops::RangeBounds; use ac_library::{Additive, Min, Segtree}; use proconio::{input, marker::Usize1, marker::Chars}; use itertools::Itertools; #[allow(unused_macros)] macro_rules! d { ( $( $x:expr ),* $(,)? ) => { eprintln!( concat!( $( stringify!($x), "={:?} " ),* ), $( $x ),* ); }; } #[allow(dead_code)] fn yn(b: bool) -> &'static str { if b { "Yes" } else { "No" } } fn main() { input! { N: usize, M: usize, SS: [String; N], } let mut xs = vec![0; M]; for s in SS.iter() { for (i, c) in s.chars().enumerate() { if c == 'o' { xs[i] += 1; } } } let mut ans = 0; for s in SS.iter() { if !s.contains('o') { continue } let b = s.chars() .zip(xs.iter()) .all(|(c, &x)| { match c { 'o' => x == 1, 'x' => true, _ => unreachable!() } }); if b { ans += 1; } } println!("{}", ans); }