Check curly braces with a counter