One of the possibilities is to use this command line:
ls -1 your/directory/ | grep -c ""
(your/directory/ is to replace by the directory you want to count its files)
your/directory/