//P1-Newbie Composer
//Q12195 - Jingle Composing

#include<stdio.h>
#include<iostream>
using namespace std;
int main() {
    char s[201];
    while(cin>>s) {
        if(s[0] == '*')    break;
        int st = 0, i, right = 0, wrong = 0, Sum = 0;
        for(i = 1; s[i]; i++) {
            if(s[i] == '/') {
                if(Sum == 1000000)    right++;
                else wrong++;
                Sum = 0;
            }
            switch(s[i]) {
                case 'W':Sum += 1000000;break;
                case 'H':Sum +=  500000;break;
                case 'Q':Sum +=  250000;break;
                case 'E':Sum +=  125000;break;
                case 'S':Sum +=   62500;break;
                case 'T':Sum +=   31250;break;
                case 'X':Sum +=   15625;break;
            }
        }
        printf("%d %d\n", right, wrong);
    }
    return 0;
}

/*
Sample Input

/HH/QQQQ/XXXTXTEQH/W/HW/
/W/W/SQHES/
/WE/TEX/THES/
*
Sample Output

4 1
3 0
0 3

--
/W/HH/QQH/EEH/SSTTSE/XXTSEQ/
/W/W/W/W/HH/W/W/QQQQ/QQH/SSSSTT/EEEEEEEES/
/HH/HH/QQH/EEQ/SSQQQTQQQ/SQSQTTHW/EHEHEHEHE/
*
3 3
9 2
3 4
--

/HH/QQQQ/XXXTXTEQH/W/HW/W/W/SQHES/WE/TEX/THES/
/W/W/SQHES/W/QQQQ/QQH/SSSSTT/EEEEEEEES/
/WE/TEX/THES/QQH/EEQ/SSQQQTQQQ/SQSQTTHW/EHEHEHEHE/
*
7 4
6 2
1 7

--
/W/HH/QQH/EEH/SSTTSE/XXTSEQ/WE/TEX/THES/QQH/EEQ/SSQQQTQQQ/SQSQTTHW/EHEHEHEHE/
*
4 10

/W/HH/QQH/EEH/SSTTSE/XXTSEQ/W/W/SQHES/W/W/SQHES/W/W/SQHES/
/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/
/HH/QQQQ/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/W/W/SQHES/
*
12 3
24 0
17 0
*/
