a = input() b = a.replace('#','') c = a.replace('(',')') d = c.split(")") l = d.count('^^*') r = d.count('*^^') print(l,r)