The origin and nature of the cosmic rays is still uncertain. However, a big progress has been achieved in recent years due to the good quality data provided by current and recent cosmic-rays observatories. The cosmic ray flux decreases very fast with energy in such a way that for energies $gtrsim 10^{15}$ eV, the study of these very energetic particles is performed by using ground based detectors. These detectors are able to detect the atmospheric air showers generated by the cosmic rays as a consequence of their interactions with the molecules of the Earths atmosphere. One of the most important observables that can help to understand the origin of the cosmic rays is the composition profile as a function of primary energy. Since the primary particle cannot be observed directly, its chemical composition has to be inferred from parameters of the showers that are very sensitive to the primary mass. The two parameters more sensitive to the composition of the primary are the atmospheric depth of the shower maximum and the muon content of the showers. Past and current cosmic-rays observatories have been using muon counters with the main purpose of measuring the muon content of the showers. Motivated by this fact, in this work we study in detail the estimation of the number of muons that hit a muon counter, which is limited by the number of segments of the counters and by the pile-up effect. We consider as study cases muon counters with segmentation corresponding to the underground muon detectors of the Pierre Auger Observatory that are currently taking data, and the one corresponding to the muon counters of the AGASA Observatory, which stopped taking data in 2004.