num = gets.split(" ").map(&:to_i) count = 0 num[0].times do input = gets.chomp w = input.count("W") count += w end puts count