main(){char s[100001];gets(s);int i=3,l=0,r=0;while(s[i]==40||s[i]==94||s[i]==42||s[i]==41){if(s[i]==42)l++;i+=5;}i=1;while(s[i]==40||s[i]==94||s[i]==42||s[i]==41){if(s[i]==42)r++;i+=5;}printf("%d %d",l,r);}