CNN Design for Counting on Simple Images
This doesn't seem like a Deep Learning problem, this could be solved by classic Computer Vision techniques, so maybe you could inspire your architecture by those.

Check is your model convolutional layers receptive field is large enough for the shapes you trying to count.

You probably won't be able to do counting without some kind of post processing

Check Yolo strategies, you probably will be able to do a counter with it.

This is a object detection problem, you will often have poor performance trying to use a architecture designed for image classification such as AlexNet while trying to face this as a regression problem.

Your output size should probably be a varying length vector from which the length is the desired count.