using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; string inpt = Reader.ReadLine(); int migi = 0; int hidari = 0; bool isNext = false; for (int i = 0; i < inpt.Length; i++) { if (inpt[i] == '(') { isNext = true; } else { if (isNext) { if (inpt[i] == '*') { migi++; } else { hidari++; } } isNext = false; } } Console.WriteLine(hidari + " " + migi); } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" (^^*)(^^*)(*^^)(*^^)(^^*)(*^^)(*^^)# "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }