using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { string S = Console.ReadLine().Replace("(^", "A").Replace("(*", "B"); int nA = S.Count(c => c == 'A'); int nB = S.Count(c => c == 'B'); Console.WriteLine(nA + " " + nB); Console.ReadLine(); } } }