N = input() right_count = N.count("(*^^)") left_count = N.count("(^^*)") print (left_count,right_count)