const input = require('fs').readFileSync('/dev/stdin', 'utf8'); const S = input.split('\n')[0]; const a = S.match(/\(\^\^\*\)/g) ? S.match(/\(\^\^\*\)/g).length : 0; const b = S.match(/\(\*\^\^\)/g) ? S.match(/\(\*\^\^\)/g).length : 0; console.log(a, b);