This paper investigates the evolution of autonomous agents that solve a memorydependent counting task. Two types of neurocontrollers are evolved: networks of McCulloch-Pitts neurons, and spiking Integrate-And-Fire networks. The results demonstrate the superiority of the spiky model in terms of evolutionary success and network simplicity. The combination of spiking dynamics with incremental evolution leads to the successful evolution of agents counting over very long periods. Analysis of the evolved networks unravels the counting mechanism and demonstrates how the spiking dynamics are utilized. Using new measures of spikiness we find that even in agents with spiking dynamics, these are usually truly utilized only when they are really needed, i.e., in the evolved subnetwork responsible for counting.