[Linux] How can I make a program that counts files in directory?

Like if the user writes "count /bin", it counts the number of files, folders and symbolic links, and if you add an option like "count -f /bin" it counts files only and so forth?
3 answers 3