Refined number of dogs function

Added ‘~’ search parameter