$_=<>;/\((?>.*?\^.*?\^.*?\*).*\)(?{++$-})^/;/\((?>.*?\*.*?\^.*?\^).*\)(?{++$%})^/;print"$- $%"