Getting number of specific element in a response

How do you get number of an element in an API response?
For example, if your response is
element: value1,
element: value2,
element:value 3

I want to check if the occurrence of element in the response is let’s say greater than 2.

Here are some examples on how to access the JSON data: