Implement a solution to find the number of connected components in a 2D grid representing land and water, the classic Count Number of Islands problem.