#include #include int main(){ int i=0,left=0,right=0; char s[10000]; scanf("%s",s); while(s[i] != '#'){ if(strncmp(&s[i],"(^^*)",5)==0) left++; else right++; i += 5; } printf("%d %d",left,right); }