using System; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; int h = 0; int m = 0; while(str.Length > 1) { //(^^*) string f = str.Substring(0, 5); if (f== "(^^*)") { h++; str = str.Remove(0,5); } else { m++; str = str.Remove(0,5); } } Console.WriteLine("{0} {1}",h,m); } }