An enumeration problem for a congruence equation