I have seen the video. The matches are loaded into a predefined mesh block. The number of matches is already counted as a predefined block is filled with matches and each block only holds a predefined number of matches.
As this on a ready made production machine, it will be very difficult (if not impossible) to change the counting method. The only thing I can suggest at the moment is to have the preloaded blocks pass a light on one side and to have a light detector check to see if there are any open holes and to reject the fill if any is detected. Pass the remaining matches to a bypass chute and refill.