Solve Euler 77