Input starts with a positive integer, 1 ≤ N ≤ 100, the number of characters in the cantina. This is followed by N lines, each line describing a character. Each of these N lines starts with the character’s name (which is distinct), then the language that character speaks, then a list of 0 to 20 additional languages the character understands but doesn’t speak. All characters understand the language they speak. All character and language names are sequences of 1 to 15 letters (a-z and A-Z), numbers, and hyphens. Character names and languages are separated by single spaces.
Print a line of output giving the size of the smallest set of characters S that should be asked to leave so that all remaining pairs of characters can converse.
7 Jabba-the-Hutt Huttese Bib-Fortuna Huttese Basic Boba-Fett Basic Huttese Chewbacca Shyriiwook Basic Luke Basic Jawaese Binary Grakchawwaa Shyriiwook Basic Jawaese R2D2 Binary Basic
6 Fran French Italian Enid English German George German Italian Ian Italian French Spanish Spencer Spanish Portugese Polly Portugese Spanish