S = raw_input() left_count = S.count("(^^*)") right_count = S.count("(*^^)") print left_count,right_count