You are given a string $S$, which is balanced parentheses with a star symbol '*' inserted.

Any balanced parentheses can be constructed using the following rules:

* An empty string is balanced.
* Concatenation of two balanced parentheses is balanced.
* If $T$ is balanced parentheses, concatenation of '(', $T$, and ')' in this order is balanced.



For example, '()()' and '(()())' are balanced parentheses. ')(' and ')()(()' 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.



Input

The input consists of a single test case formatted as follows.


$S$


$S$ is balanced parentheses with exactly one '*' inserted somewhere. The length of $S$ is between 1 and 100, inclusive.

Output

Print the answer in one line.

Examples

Input

((*)())


Output

2


Input

(*)


Output

1


Input

(()())*


Output

0


Input

()*()


Output

0


Input

((((((((((*))))))))))


Output

10


Input

*


Output

0
#include <bits/stdc++.h>
using namespace std;

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

//↓0-originか1-originでn回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-origin昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-origin昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-origin降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-origin降順
//rep2 -> 第二引数 m から n 回繰り返し ex) m=5 n=3 なら i=5,i=6,i=7 まで
#define rep2(i,m,n) for(int i = ((int)(m)); i < ((int)(n))+((int)(m)); i++)
#define SIZE(x) ((int)((x).size()))
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<int,int> PII;
template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

/* 円周率は M_PI を使おうね */
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;

/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    //cout << fixed << setprecision(10);

    string s;
    cin >> s;
        int cnt = 0, cnt2 = 0;
        rep(i, s.size()) {
            if(s[i]=='(') cnt++;
            else if(s[i]==')') cnt = max(cnt-1, 0);
            else if(s[i]=='*') chmax(cnt2, cnt);
        }
        cout << cnt2 << '\n';
    
}
