import sys
chars = open(sys.argv[1]).read()
print(chars.count('(') - chars.count(')'))
curr = 0
for c in range(len(chars)):
    if chars[c] == '(':
        curr += 1
    else:
        curr -= 1
    if curr < 0:
        print(c + 1)
        break

b55c2bd23eeb3c63488cc58937f26800d717da68
<mask token>

<mask token>
print(chars.count('(') - chars.count(')'))
<mask token>
for c in range(len(chars)):
    if chars[c] == '(':
        curr += 1
    else:
        curr -= 1
    if curr < 0:
        print(c + 1)
        break

<mask token>
chars = open(sys.argv[1]).read()
print(chars.count('(') - chars.count(')'))
curr = 0
for c in range(len(chars)):
    if chars[c] == '(':
        curr += 1
    else:
        curr -= 1
    if curr < 0:
        print(c + 1)
        break

import sys
chars = open(sys.argv[1]).read()
print(chars.count('(') - chars.count(')'))
curr = 0
for c in range(len(chars)):
    if chars[c] == '(':
        curr += 1
    else:
        curr -= 1
    if curr < 0:
        print(c + 1)
        break
