Count problem and display

Put the code that displays the number in a function and call it when required