count number of collisions