#C3859. Taco King's Dishes

    ID: 47332 Type: Default 1000ms 256MiB

Taco King's Dishes

Taco King's Dishes

In this problem, the Taco King wants to know the maximum number of dishes he can prepare. You are given two integers (n) and (m), where (n) is the number of dishes and (m) is the number of available ingredients. Then, (n) lines follow, each representing a dish. Each dish is described by a list of required ingredient IDs. The first number on each line indicates the count of ingredients for that dish, followed by the respective ingredient IDs. Under the assumption that all dishes can be prepared, your task is to output the number of dishes, i.e. (n).

Note: Even though the ingredient requirements are provided, they do not affect the answer in this problem; the answer is simply the total number of dishes provided.

inputFormat

The input is read from stdin and is formatted as follows:

  • The first line contains two integers \(n\) and \(m\) separated by a space, where \(n\) is the number of dishes and \(m\) is the number of available ingredients.
  • Each of the following \(n\) lines describes a dish. Each dish description starts with an integer \(k\) (the number of ingredients required) followed by \(k\) space-separated integers representing the ingredient IDs.

outputFormat

The output, written to stdout, should be a single integer representing the maximum number of dishes the king can prepare. In this problem, it is simply (n), the total number of dishes.## sample

5 3
3 2 1 3
3 2 2 3
2 1 1
1 0
4 3 1 2 3
5