""" """ str = input() print(str.count("(^^*)"),end = ' ') print(str.count("(*^^)"))