s = input() n = len(s) ANS = [0, 0] idx = 0 while True: if s[idx] == '#': break if s[idx: idx + 5] == '(^^*)': ANS[0] += 1 else: ANS[1] += 1 idx += 5 print(*ANS)