#include int main() { int c, total = 0; while ((c = getchar()) != EOF) { total += (c == '(') - (c == ')'); } printf("%d\n", total); return 0; }