print((function (s) local r=0 for i=1,#s do if s:sub(i,i)=="W" then r=r+1 end end return r end)(io.stdin:read("*a")))