L = "(^^*)" R = "(*^^)" S = input() lc, rc = 0, 0 for i in range( 0, len( S ), len( L ) ): if S[ i : i + len( L ) ] == L: lc += 1 else: rc += 1 print( lc, rc )