Solution for a simple challenge about performing calculations on text files