PC parallel port does have a few bits that can be read in the printer status register. Just take whatever the number of bits you need to count your nuts, which may be defined as a leading edge plus a trailing edge (010.
Obviously the case of two or more nuts stick together must be considered.