const input = require('fs').readFileSync('/dev/stdin', 'utf8'); let S = input.replace(/\s/, ''); console.log( Math.min( S.match(/c/g).length - 1, S.match(/w/g).length ) );