Guess the Animal#10331

Guess the Animal

1 second
128 megabytes
Very easy

When the cows get bored of playing the "shell game", Bessie and her friend Elsie like to play another game — "guess the animal".

First, Bessie thinks of some animal (most of the time it's a cow, which makes the game rather dull, but sometimes Bessie gets creative and picks something else). Then Elsie asks a series of yes-or-no questions to figure out which animal Bessie has in mind. Each question concerns whether the animal has a certain characteristic, and Bessie answers each one with "yes" or "no". For example:

Elsie: "Does the animal fly?"
Bessie: "no"
Elsie: "Does the animal eat grass?"
Bessie: "yes"
Elsie: "Does the animal give milk?"
Bessie: "yes"
Elsie: "Does the animal say 'moo'?"
Bessie: "yes"
Elsie: "In that case, I think it’s a cow."
Bessie: "Correct!"

Let us call a feasible set the set of all animals whose characteristics are consistent with Bessie's answers to Elsie's questions. Elsie continues asking questions until the feasible set contains exactly one animal, at which point she declares that animal as her answer.

Each time, Elsie chooses the next question by picking some characteristic belonging to an animal in the current feasible set — even if that question might not necessarily help her narrow down the options further. She never asks about the same characteristic twice.

Given all the animals known to Bessie and Elsie, along with their characteristics, determine the maximum number of "yes" answers Elsie could possibly receive before she correctly guesses the animal.

Input

The first line contains an integer n~(2 \le n \le 100) — the number of animals. Each of the following lines describes one animal. A line begins with the animal's name, followed by an integer k~(1 \le k \le 100) — the number of its characteristics, then characteristics themselves.

Animal names and characteristics are strings of lowercase Latin letters with lengths up to . No two animals have exactly the same set of characteristics.

Output

Print one integer — the maximum number of "yes" answers Elsie could receive before the game ends.

Examples

In the given example, Elsie can produce a dialogue with "yes" answers (as shown above), and it is impossible to construct one with more than positive answers.

Example 1

Loading
Loading