There are $2$ coaches in the school training team, and there are $n$ teams in total, numbered $1 \sim n$. This year there are $m$ CCPC regional contests, and each team can participate in at most $2$ CCPC regionals (some teams may participate in $0$ CCPC regionals).
Each contest site gives a gift to the coach of each participating team. However, if at the same site several participating teams have the same coach, that site gives only one gift to that coach.
Now, each team has already decided which contest sites it will participate in, but the coaches have not yet been entered into the CCPC system. In the CCPC system, each team can only be assigned $1$ coach, and once entered, it cannot be changed.
Please assign a coach to each team reasonably, so that the total number of gifts received by these $2$ coaches is maximized.
Input
The first line contains two integers $n, m$ $(1 \le n, m \le 10^6)$, representing the number of teams and the number of contest sites.
In the next $m$ lines, each line first contains an integer $k$ $(0 \le k \le n)$, representing the number of teams from the school participating in that site; then it contains $k$ integers representing the team numbers participating in that site. It is guaranteed that these $k$ integers are pairwise distinct.
Output
Output a single integer, the maximum total number of gifts the two coaches can receive.
Examples
Input 1
3 3 2 1 2 2 1 3 2 2 3
Output 1
5
Input 2
3 3 2 1 3 2 2 3 0
Output 2
4