S = input() i = 0 A = [] while i < len(S): a = S[i: i + 5] i = i + 5 A.append(a) l = A.count("(^^*)") r = len(A) - l - 1 print(l,r)