I'm guessing that by "counting numbers" you're refering to "integers."
Why not actually write out the numbers that qualify, and then count them?
{2, 3, 5, 6} is a set of four numbers, all of which are fewer than 3 units away from the (central) number 4. Some people would include 4 itself in this set.