#include #include #include #include #include using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); string s; cin >> s; int cnt1 = 0, cnt2 = 0; for(int i = 0; i < s.size() - 1; i++){ if(s[i] == '*' && s[i+1] == ')') cnt1++; if(s[i] == '*' && s[i+1] == '^') cnt2++; } cout << cnt1 << " " << cnt2 << endl; }