class Solution(object):
def maxDepth(self, s):
"""
:type s: str
:rtype: int
"""
cnt = 0
ans = 0
for c in s:
if c == "(":
cnt += 1
ans = max(cnt, ans)
elif c == ")":
cnt -= 1
return ans