最大独立集
#include <iostream>
#include <cstdio>
#include <queue>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <algorithm>
//#include "myAlgorithm.h"
#define MAX 10005
#define OFFENCE (1e9 + 5)
#define INF (1e8 + 5)
#define eps 1e-9
#define Rep(s, e) for( int i = s; i <= e; i++)
#define Cep(e, s) for( int j = e; j >= s; j --)
#define PI acos(-1.0)
//#pragma comment(linker, "/STACK:36777216")
using namespace std;
int n;
int match[MAX],v[MAX];
vector<vector<int> >adj;
bool find(int node){
int len = adj[node].size(), pos;
Rep(0, len - 1){
pos = adj[node][i];
if(!v[pos]){
v[pos] = 1;
int pre = match[pos];
if(pre == -1 || find(pre)){
match[pos] = node;
//match[node] = pos;
return true;
}
}
}
return false;
}
int main() {
while(cin>>n){
adj.assign(n + 1, vector<int>() );
memset(match, -1, sizeof(match));
int c, a, s;
Rep(0, n - 1){
scanf("%d: (%d)", &s, &c);
//cout<<c<<endl;
for(int j = 0; j < c;j++){
scanf("%d", &a);
adj[s].push_back(a);
//cout<<a<<endl;
}
}///end make adj;
int ans = 0;
for(int i = 0; i < n; i++){
if(find(i))ans++;
memset(v, 0, sizeof(v));
}
//cout<<ans<<endl;
cout<<n - ans/2<<endl;
}
return 0;
}
/**
*/