#include using namespace std; int main() { // 1. 入力情報取得. string S; cin >> S; // 2. 汚れて読めない1つの文字は? string const LEFT = "(^^*)"; string const RIGHT = "(*^^)"; int lAns = 0; int rAns = 0; for(int i = 0; i < S.size(); i += 5){ if(S[i] == '#') break; string s = {S[i], S[i + 1], S[i + 2], S[i + 3], S[i + 4]}; if(LEFT == s) lAns++; if(RIGHT == s) rAns++; } // 3. 後処理. cout << lAns << " " << rAns << endl; return 0; }