S = input() left, right = S.count('(^^*)'), S.count('(*^^)') print(f'{left} {right}')