How to count name in JSON object

in general it is dependend to the JSON structure. Also we cannot derrive if name related to the Property name or to the value of a particular property.

Have also a look on the SelectTokens where we retrieve all descendants in a relative way

myJObject - outpur from Deserialize JSON
myJObject.SelectTokens("..YourPropertyName").Count

Maybe you can share the JSON or sample data with us, when more help is needed