defmodule Main do
  def main() do
    input = IO.gets("") |> String.trim() |> String.split() |> Enum.map(&(String.to_integer(&1)))
    n = input |> Enum.at(0)
    k = input |> Enum.at(1)
    num = get_inp(k)  |> List.flatten()|> Enum.uniq() |> Enum.count()
    IO.puts(n-num)
  end

  def get_inp(0, result), do: result
  def get_inp(num, result \\ []) do
    d = IO.gets("") |> String.trim() |> String.to_integer()
    input = IO.gets("") |> String.trim() |> String.split()|> Enum.map(&(String.to_integer(&1)))
    result = result ++ [input]
    get_inp(num-1, result)
    end
end