B - Trick or Treat Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200

問題文

ある街に、N 人のすぬけ君(すぬけ君 1 、すぬけ君 2 、 ...、 すぬけ君 N )が住んでいます。

この街には、 K 種類のお菓子(お菓子 1 、 お菓子 2 、....、お菓子 K )が売られています。お菓子 i を持っているのは、すぬけ君 A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}} の計 d_i 人です。

高橋君は今からこの街を回り、お菓子を 1 つも持っていないすぬけ君にいたずらをします。このとき、何人のすぬけ君がいたずらを受けるでしょうか。

制約

  • 入力は全て整数
  • 1 \leq N \leq 100
  • 1 \leq K \leq 100
  • 1 \leq d_i \leq N
  • 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N

入力

入力は以下の形式で標準入力から与えられる。

N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}

出力

答えを出力せよ。


入力例 1

3 2
2
1 3
1
3

出力例 1

1
  • すぬけ君 1 はお菓子 1 を持っています。

  • すぬけ君 2 はお菓子を持っていません。

  • すぬけ君 3 はお菓子 1, 2 を持っています。

以上より、いたずらを受けるのはすぬけ君 2 の一人です。


入力例 2

3 3
1
3
1
3
1
3

出力例 2

2

Score : 200 points

Problem Statement

N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.

There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.

Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Constraints

  • All values in input are integers.
  • 1 \leq N \leq 100
  • 1 \leq K \leq 100
  • 1 \leq d_i \leq N
  • 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N

Input

Input is given from Standard Input in the following format:

N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}

Output

Print the answer.


Sample Input 1

3 2
2
1 3
1
3

Sample Output 1

1
  • Snuke 1 has Snack 1.
  • Snuke 2 has no snacks.
  • Snuke 3 has Snack 1 and 2.

Thus, there will be one victim: Snuke 2.


Sample Input 2

3 3
1
3
1
3
1
3

Sample Output 2

2