#include using namespace std; using ll = long long; #define fi first #define se second int main(){ string s; cin >> s; int n = s.size(); int left = 0, right = 0; for(int i = 0; i < n - 1; i += 5){ if(s.substr(i, 5) == "(^^*)") left++; else if(s.substr(i, 5) == "(*^^)") right++; } cout << left << " " << right << endl; return 0; }