You are mapping a faraway planet with a satellite. The planet's surface is a grid, and the satellite captured one image of that surface. Each grid cell is land (written as 'L'), water (written as 'W'), or covered by clouds (written as 'C'). A cell covered by clouds can be either land or water, and you cannot tell which.
An island is a region of land cells in which every two cells are connected to each other by a path that only moves up, down, left, or right.
Given the image, find the smallest number of islands that is consistent with it.