S=input(str()) R=0 L=0 Sa=str("|"+S) ta=str.maketrans while 1: if "|(^^*)" in Sa: Sa=Sa.replace("|(^^*)","|") L+=1 elif "|(*^^)" in Sa: Sa=Sa.replace("|(*^^)","|") R+=1 else: break print(L,R,"\n")