#include #define rep(x, to) for (int x = 0; x < (to); x++) #define REP(x, a, to) for (int x = (a); x < (to); x++) #define EPS (1e-14) #define _PA(x,N) rep(i,N){cout< PII; typedef pair PLL; typedef complex Complex; typedef vector< vector > Mat; string s; string LEFT = "(^^*)"; string RIGHT = "(*^^)"; int ansl, ansr; void solve() { int size= s.size(); for (int i = 0; i <= size - (int)LEFT.size(); i+=LEFT.size()) { string sub = s.substr(i, LEFT.size()); if (sub == LEFT) ansl++; else ansr++; } cout << ansl << " " << ansr << endl; } int main() { cin >> s; solve(); return 0; }