N,M  = (int(X) for X in input().split())
Food = set(range(1,M+1))
for T in range(0,N):
    Food = Food.intersection(set([int(X) for X in input().split()][1:]))
print(len(Food)) int(X) for X in input().split() for X in input().split() X input().split() ().split () input split for X in input().split() int(X) int X N,M  = (int(X) for X in input().split()) N (int(X) for X in input().split()) M Food = set(range(1,M+1)) Food set(range(1,M+1)) set range(1,M+1) range 1 M+1 M 1 for T in range(0,N):
    Food = Food.intersection(set([int(X) for X in input().split()][1:])) T range(0,N) range 0 N int(X) for X in input().split() for X in input().split() X input().split() ().split () input split for X in input().split() int(X) int X Food = Food.intersection(set([int(X) for X in input().split()][1:])) Food Food.intersection(set([int(X) for X in input().split()][1:])) Food.intersection Food intersection set([int(X) for X in input().split()][1:]) set [int(X) for X in input().split()][1:] [int(X) for X in input().split()] 1: 1 print(len(Food)) print len(Food) len Food Food = Food.intersection(set([int(X) for X in input().split()][1:])) Food.intersection(set([int(X) for X in input().split()][1:])) Food M  = (int(X) for X in input().split()) (int(X) for X in input().split()) M N,M  = (int(X) for X in input().split()) (int(X) for X in input().split()) N Food = set(range(1,M+1)) set(range(1,M+1)) Food
N,M  = (int(X) for X in input().split())
Food = set(range(1,M+1))
for T in range(0,N):
    Food = Food.intersection(set([int(X) for X in input().split()][1:]))
print(len(Food))