Welcome to the Monastery. I've upvoted your post because you have made an effort to write some code and also do some research; don't worry too much about the downvotes as formatting faux pas often receive a negative reaction. Please don't let this put you off the Monastery, keep visiting as it is a great learning resource.
Other Monks have given good advice and have covered the most important points. I would just like to draw your attention to a couple of further glitches.
- A minor point, you have forgotten to say what you are counting in the last two lines of your output :-)
- More seriously, your logic for counting paragraphs will fail if you have a trailing empty line (or lines) at the end of your data file. You should also consider how you wish to treat lines that just contain spaces and also multiple blank lines between paragraphs.
I hope these thoughts are helpful.
Cheers,
JohnGG