#include <string>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    string s; cin >> s;
    int par = 0, ans = 0;
    for(size_t i=0; i<s.size(); i++) {
        if(s[i] == '(') par++;
        if(s[i] == ')') par--;
        if(s[i] == '*') ans = par;
    }
    cout << ans << endl;
    return 0;
}

