S = list(input().split(')')) left = S.count('(^^*') right = S.count('(*^^') print('{0} {1}'.format(left, right))