I tried to solve it without regexp at first, failed brutally. Cut the line count by 80% using a regexp instead. It was also funny to get all square roots.