During the course of normal brain development, what comes first:
- logical thinking or
Counting, easily. It's a matter of rote and repetition, dominated by procedural learning. Critical thinking requires more advanced circuitry and learning. There is a lot of really rapid neural development still occurring in the first couple years and children are learning from society and parents and experience in the meantime. During this time, they can easily count and say the alphabet.
Logical thinking isn't apparent until around 3 or 4, though I suppose a robust discussion would require a formal definition of what constitutes logic.
For a real answer on this topic, you need two things: one is to understand your question, and the other is an understanding of Jean Piaget's masses of research into the development of intelligence (from birth to adulthood). Regarding understanding your own question, you must appreciate that decades of philosophy and psychology reveal that you cannot separate logic from mathematics. Even at the simplest of levels , young children around 4 years old will demonstrate semi-logical skills together with primitive counting skills. The reason for all this is that the level of abstraction above perception (i.e. in thinking) required for both logic and number is the same, and there is a hierarchy of such abstractions that can be traced throughout the development of intelligence common to every individual. Jean Piaget is the one you want to read, and epistemology (study of knowledge) is the domain you are asking about.