using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Contest { class Program { static void Main(string[] args) { int left = 0, right = 0; var S = Console.ReadLine(); for (int i = 0; S[i] != '#'; i += 5) { if (S.Substring(i, 5) == "(^^*)") { ++left; } else { ++right; } } Console.WriteLine($"{left} {right}"); } } }