S = raw_input() l = S.count("(^^*)") r = S.count("(*^^)") print l,r