0

Brain-Flak, 97 bytes (96 for code, 1 for flag)
{}<>(())({<(<()>)<>({<({}[()])><>([{}]())<>}{})<>(<{}>())<>{({}[()])<>([{}])<>}{}<>({}{})>()}{})
Run with the -a flag.
Try it online!
Explanation:
{} #skip the first open bracket and
<>(()) #place a 1 on stack B, representing the nesting d...