import strutils, sequtils let tmp = map(split readLine stdin, parseInt) N = tmp[0] M = tmp[1] var cnt = 0 for n in 0 ..< N: let A = readLine stdin cnt += count(A, "W") echo cnt