时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Everybody knows that jiry_2 = Syloviaely.
There are

different accounts on the website, and some of them competed in the recent

contests. However, Mike suspects that there are lots of alternative accounts.
There are axioms believed by everyone that nobody can use two different in one contest simultaneously and each account can be owned by only one person. So different accounts without overlapping contest participation can be owned by the same person.
Mike wants to know the minimum possible number of different people behind these accounts.
输入描述:
The first line contains two integers
.
Each of the following
lines contains an integer )
first, followed by
distinct integers
indicating the accounts participating the contest.
Some accounts may not participate in any contests.
输出描述:
Output one integer - the answer.
示例1
输入
复制
5 3
2 1 2
3 2 3 4
4 4 5 1 2