program pro5
    implicit none
    character(len=2*10**5)::C
    integer::i, j, b, ans
    read(*,*) C
    b = 0
    ans = 0

    do i = 1, len_trim(C)
        if((C(i:i) .eq. 'W') .and. (b == 1)) then
            ans = ans + b + 1
            b = 0
        else if(C(i:i) .eq. 'W') then
        	ans = ans + b
            b = 0
        else
            b = b+1
        end if
    end do

    write(*,*) ans
    stop

end program pro5