How Can a Venus Flytrap Count Without a Brain?
A Venus flytrap must distinguish a crawling insect from a raindrop or falling leaf. It does this by responding to a sequence of electrical signals.
Each trap contains sensitive trigger hairs. Bending one produces an electrical impulse that spreads through the leaf. A single touch normally does not close the trap. If another signal arrives within roughly half a minute, the plant snaps its lobes together in about a tenth of a second.
This brief electrical memory prevents the plant from wasting energy on accidental contact. Closing and reopening a trap consumes resources, so reacting to every raindrop would be costly. Gaps between the interlocking teeth also allow very small insects to escape because they may not provide enough nutrition to justify digestion.
After capture, continued struggling bends the hairs again. Additional signals encourage the trap to seal more tightly and begin producing digestive chemicals. The amount of digestive activity can increase according to the number of signals produced by the prey.
The plant is not consciously counting. Changes in calcium and electrical activity preserve information about recent touches. Without nerves or a brain, the flytrap uses cellular chemistry as a temporary memory.
Source: Calcium Dynamics During Trap Closure, Nature Plants - Carnivorous Plants: Physiology, Ecology, and Evolution, Aaron Ellison and Lubomír Adamec When Did Zero Become a Number?

Sunrise in morning mist near Dülmen (Hülstener Straße), North Rhine-Westphalia, Germany
Source: Dietmar Rabich