#include using namespace std; int main(){ string s; cin >> s; int left=0, right=0; for(int i=1; s[i]!='#'; i++){ if(s[i-1]=='^'){ if(s[i]=='*'){ left++; } } if(s[i-1]=='('){ if(s[i]=='*'){ right++; } } } cout << left << ' ' << right << endl; return 0; }