import re text = input() print(len(re.findall(r'\(\^\^\*\)', text)), end=" ") print(len(re.findall(r'\(\*\^\^\)', text)))