|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||23||20||18||90.000%|
You are given a string $S$, which is balanced parentheses with a star symbol
Any balanced parentheses can be constructed using the following rules:
(, $T$, and
)in this order is balanced.
(()()) are balanced parentheses.
)()(() are not balanced parentheses.
Your task is to count how many matching pairs of parentheses surround the star.
Let $S_i$ be the $i$-th character of a string $S$. The pair of $S_l$ and $S_r$ $(l < r)$ is called a matching pair of parentheses if $S_l$ is
(, $S_r$ is
) and the surrounded string by them is balanced when ignoring a star symbol.
The input consists of a single test case formatted as follows.
$S$ is balanced parentheses with exactly one
* inserted somewhere. The length of $S$ is between $1$ and $100$, inclusive.
Print the answer in one line.