#include"bits/stdc++.h" using namespace std; int main() { string s; cin >> s; if (s[0] == '#') { cout << 0 <<" "<< 0 << endl; return 0; } int cntr=0, cntl=0; for (int i = 0; i < s.length(); i++) { if (s[i] == '*') { if (s[i + 1] == ')') { cntl++; } else if (s[i + 1] == '^') { cntr++; } } } cout << cntl <<" "<< cntr << endl; }