inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
S = inp.shift().split('')
cnt = 0
i = 0
j = S.length - i 
b = 1
f = 0
while(i<j) {
    if (S[i]== 'B') {
        if (S[i+1] == 'W') {
            S[i] = 'W'
            S[i+1] = 'B'
            cnt++
        }
    } else {
        if (b) {
            f++
        }
    }
    i++
    if (i==j) {
        i = f
        j--
    }
}
console.log(i,j,cnt)