console.log(require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0].match(/mi.*?n/g).length);