S = raw_input() L, R = 0, 0 N = len(S) for i in range(0,N-5): if S[i:i+5] == "(^^*)": L += 1 elif S[i:i+5] == "(*^^)": R += 1 print L, R