You can use
sort input.txt | uniq -c
which will output
3 help
2 how
1 luke
1 mark
from which you could continue processing the output. If you already know that the same entries are in a continuous block of lines you could of course skip the sort
and use uniq
directly, which will also preserve the order.