N = int(input()[0]) x = 0 for _ in range(N): x += input().count('W') print(x)