s = input() a, b = s.count("(^^*)"), s.count("(*^^)") print(a, b)