import re def main(): S = input() bracketsL, bracketsR = [], [] s = S.find('(') e = len(S) - S[::-1].find(')') for i, t in enumerate(S[s:e]): if t == '(': bracketsL.append(i + s) elif t == ')': bracketsR.append(i + s + 1) bracketsL.sort(reverse=1) regexl = re.compile(r'\^.*\^.*\*') regexr = re.compile(r'\*.*\^.*\^') left, right = 0, 0 for i in bracketsL: flagL, flagR = False, False for j in bracketsR: if not flagL and regexl.search(S[i:j]) is not None: flagL = True if not flagR and regexr.search(S[i:j]) is not None: flagR = True if flagL: left += 1 if flagR: right += 1 print(left, right) main()