How to loop read command and print valid invalid states.?

My question is how would i loop a read command to keep asking the user for input and eventually print the no. of valid invalid inputs after a specified control input typed i.e. (-3).

Please show us what you have tried so far.

Why look for a specific string to terminate input? Why not just use End-Of-File (ctl-d for interactive input)?

Is this a homework assignment?