memorize number of islands