Counting Macro

looking for some way to make a template sensor to count how many of a set of specifically named sensors have a specific value. ie:

sensor.one
sensor.two
sensor.three

and then how many of a value of ‘N/A’

is there even a way to do this?