print(sum({'(': 1, ')': -1}[c] for c in open('input').read().rstrip('\n')))