Solve Proj Euler problem 008.