Do this for as many different conditions as you want! Make sure to preview and test along the way. Copy and edit this activity if you want an example.
countNumberUsage
This function is the heart and soul of many of these puzzles because it enforces the rules for what can, cannot, and must be used. In a nutshell, it counts either the total amount of numbers or the total amount of a particular number in any string.
If you want to count all of the numbers in, for example, a math input:
countNumberUsage(input.latex)
And if you want to count a particular number (in this case, 5), add an argument:
countNumberUsage(input.latex,5)
Stuck? Try this out. You can even use a variable in place of your second argument to make it easy to switch between numbers.