import re s=input() p=re.compile('\(\*\^\^\)') r=len(list(p.findall(s))) p=re.compile('\(\^\^\*\)') l=len(list(p.findall(s))) print(l,r)