Given an input file containing one single number per line, how could I get a count of how many times an item occurred in that file?
cat input.txt 1 2 1 3 1 0
You mean you want a count of how many times an item appears in the input file? First sort it (using -n if the input is always numbers as in your example) then count the unique results.
-n
sort -n input.txt | uniq -c