As Vette said speed is not really relevant. What is relevant is detecting the bad product AND counting the product at same time. You will need to use a device that allows you to determine count and position when a bad product is detected you will know which to reject.
Simple example: A word uses 16 bits so we count up to 16. This word is all zeroes until a bad product is detected then a 1 gets placed in the word address, each time a good bottle comes thru that 1 shifts (FIFO, BSL, BSR all depends). There are a variety of ways to do this but to keep it simple we have one bad product and good products are entering until the "1" for the bad product is at a certain point...which triggers the reject. Lets say we have 16 bottles, the first one is bad, the good come in and the bit shifts till its at the 16th position...the plc seeing a "1" in the 16th position triggers the reject.
There are examples of this on this site and others but if you take the time to figure it out yourself you will benefit alot more.