#B3966. Knowledge Points Inclusion Scoring

    ID: 11623 Type: Default 1000ms 256MiB

Knowledge Points Inclusion Scoring

Knowledge Points Inclusion Scoring

There are \( n \) questions. Each question's standard answer consists of \( m \) integers, representing the IDs of the required knowledge points. For the \( i\text{-th} \) question (\( 1 \leq i \leq n \)), your answer consists of \( l_i \) integers, representing the IDs of the knowledge points you selected.

For each question \( i \), if your answer contains all the \( m \) integers of the standard answer (i.e. the set of your answers is a superset of the standard answer), you get 2 points; otherwise, you get 0 points. Note that even if your answer includes extra knowledge points that are not in the standard answer, it does not affect the scoring.

Your task is to compute the total score you obtain in this test.

inputFormat

The input is given as follows:

  • The first line contains two integers \( n \) and \( m \) separated by a space.
  • The next \( n \) lines each contain \( m \) integers; the \( i\text{-th} \) of these lines represents the standard answer for the \( i\text{-th} \) question.
  • The following \( n \) lines describe your answers. Each of these lines begins with an integer \( l_i \) (the number of integers in your answer for that question), followed by \( l_i \) integers representing your chosen knowledge point IDs.

All integers are separated by spaces.

outputFormat

Output a single integer representing your total score.

sample

1 2
10 20
2 10 20
2