Solve Euler 87