#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    string S; cin >> S;
    int idx = 0;
    int ans = 0;
    while(S[idx++] != '*');
    while(idx < S.length()){
        if(S[idx] == '(') ans--;
        else ans++;
        idx++;
    }
    cout << ans << endl;
    return 0;
}
