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