Count the number of rotations