let input = require('fs').readFileSync('/dev/stdin', 'utf8'); const ans = input.match(/c[^c]*w.*?w/g); console.log(ans ? ans[0].length : -1);