#include using namespace std; int main() { while(true) { int N; cin >> N; string line; cin >> line; if(cin.eof()){ return 0; } cout << N / 2 << endl; // int oneCount = 0; // char nextChar; // char prevChar; // // for(int i = 0; i < N; i++){ // cin >> nextChar; // if(nextChar == '('){ // oneCount++; // } 10 ((())(())) // } // cout << oneCount << endl; // cin >> prevChar; // for(int i = 1; i < N; i++){ // cin >> nextChar; // if(prevChar == '('){ // if(nextChar == ')'){ // oneCount++; // } // } else { // if(nextChar == ')'){ // oneCount++; // } else { // } // } // prevChar = nextChar; // } // cout << oneCount << endl; } return 0; }