#include #define int long long using namespace std; signed main() { string S; cin >> S; int L = 0; int R = 0; for( int i = 0; i < S.size(); i++ ){ if( S.substr(i, 5) == "(^^*)" ) L++; else if( S.substr(i, 5) == "(*^^)" ) R++; } cout << L << " " << R << endl; }