fn main() { let stdin = std::io::read_to_string(std::io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let n: usize = stdin.next().unwrap().parse().unwrap(); let _m: usize = stdin.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| stdin.next().unwrap().parse().unwrap()) .collect(); println!("{}", output(solve(a))); } fn solve(a: Vec) -> usize { a.into_iter() .map(|a| a.bytes().filter(|&a| a == b'W').count()) .sum() } fn output(ans: usize) -> usize { ans }