#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) const double PI = acos(-1); string replace_all(string s, string target, string x) { int pos = 0; while ((pos = s.find(target, pos)) != string::npos) { s.replace(pos, target.length(), x); pos += x.length(); } return s; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; string x = "(^^*)"; string y = "(*^^)"; s = replace_all(s, x, "x"); s = replace_all(s, y, "y"); cout << count(s.begin(), s.end(), 'x') << " " << count(s.begin(), s.end(), 'y') << endl; return 0; }