Input may contain multiple lines (if pasted)

This splits the input up by newline and then processes it all separately, ignoring empty lines.