scan = string.gmatch(io.read(),"%d+") n = scan() scan() w = string.byte("W") result = 0 for i = 1, n do local s = io.read() local t = {s:byte(1,s.len(s))} for j , v in ipairs(t) do if v == w then result = result + 1 end end end print(result)