Volume 4, Book 52, Number 293 :
Narrated by Hudhaifa (radiallaahu `anhu)
The Prophet (sallallaahu `alayhi wasallam) said (to us), ” List the names of those people who have announced that they are Muslims.” So, we listed one thousand and five hundred men. Then we wondered, “Should we be afraid (of infidels) although we are one thousand and five hundred in number?” No doubt, we witnessed ourselves being afflicted with such bad trials that one would have to offer the prayer alone in fear.
This count was done for either Uhud or before digging the Trench or at Hudaibiyah, according to the commentary. It was just a reassurance for Muslims and a confidence booster. Ultimately, all help is from Allah, as was proved in Badr, but having that advantage of number certainly helps.
Volume 4, Book 52, Number 294 :
Narrated by Al-A`mash (radiallaahu `anhu)
“We (listed the Muslims and) found them five hundred.” And Abu Muawiya (radiallaahu `anhu) said, “Between six-hundred to seven-hundred.”