def mainProc(s) : left = s.count('(^^*)') right = s.count('(*^^)') print (left, right) if __name__ == '__main__' : s = input() mainProc(s)