Writing Tasks
문제
In 2020, there are programming contests held in Indonesia, numbered from to . Each contest has zero or more tasks written for the contest. There are task authors who can write tasks for these contests, numbered from to . The th task author only likes the set of contests , and only wants to write tasks for contests in . Each task author cannot write more than one task for the same contest.
There are also topics in programming contest tasks, numbered from to . For example, topic 1 might be about graph tasks, topic 2 might be about string tasks, and so on. Each task has exactly one topic. The th task author is familiar with the set of topics , and only wants to write tasks about topics in . Each task author cannot write more than one task about the same topic.
Additionally, each contest also has a syllabus. The th contest syllabus contains the set of topics , and the topic for the tasks written for the contest must be in . Each contest cannot have more than one task for the same topic.
You are a programming contest enthusiast in Indonesia. Surprisingly, you observed the following:
- Each task author likes at most two contests. Similarly, each contest is liked by at most two task authors.
- Each task author is familiar with at most two topics. Similarly, each topic is familiarized by at most two task authors.
- Each contest has at most two topics in its syllabus. Similarly, each topic is present in at most two contest syllabuses.
You want to find the maximum total number of tasks that can be written across all contests.
입력
Input begins with a line containing three integers: () representing the number of task authors, contests, and topics, respectively.
The next lines each begins with an integer: () representing the number of contests that the th task author likes, followed by integers: () representing the liked contests. It is guaranteed that the values in are distinct. It is also guaranteed that for all , the value only appears at most twice in .
The next A lines each begins with an integer: () representing the number of topics that the th task author is familiar with, followed by integers: () representing the familiarized topics. It is guaranteed that the values in are distinct. It is also guaranteed that for all , the value only appears at most twice in .
The next lines each begins with an integer: () representing the number of topics in the th contest syllabus, followed by integers: () representing the topics in the syllabus. It is guaranteed that the values in are distinct. It is also guaranteed that for all , the value only appears at most twice in .
출력
Output in a line an integer representing the maximum total number of tasks that can be written across all contests.
예제
예제 1
2 3 2 2 1 2 2 2 3 1 1 1 1 1 1 1 1 1 2
2