N, M = [int(x) for x in input().split()]
Like = [0 for _ in range(M+1)]
for i in range(N):
  KA = [int(x) for x in input().split()]
  for j in range(1, KA[0]+1):
    Like[KA[j]] += 1
ans = 0
for i in range(M+1):
  if(Like[i]==N):
    ans += 1
print(ans) 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 0 for _ in range(M+1) for _ in range(M+1) _ range(M+1) range M+1 M 1 for _ in range(M+1) 0 Like = [0 for _ in range(M+1)] Like [0 for _ in range(M+1)] for i in range(N):
  KA = [int(x) for x in input().split()]
  for j in range(1, KA[0]+1):
    Like[KA[j]] += 1 i range(N) range 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 KA = [int(x) for x in input().split()] KA [int(x) for x in input().split()] for j in range(1, KA[0]+1):
    Like[KA[j]] += 1 j range(1, KA[0]+1) range 1 KA[0]+1 KA[0] KA 0 1 Like[KA[j]] += 1 Like[KA[j]] Like KA[j] KA j 1 ans = 0 ans 0 for i in range(M+1):
  if(Like[i]==N):
    ans += 1 i range(M+1) range M+1 M 1 if(Like[i]==N):
    ans += 1 Like[i]==N Like[i] Like i N ans += 1 ans 1 print(ans) print ans M = [int(x) for x in input().split()] [int(x) for x in input().split()] M Like = [0 for _ in range(M+1)] [0 for _ in range(M+1)] Like ans = 0 0 ans N, M = [int(x) for x in input().split()] [int(x) for x in input().split()] N KA = [int(x) for x in input().split()] [int(x) for x in input().split()] KA ans += 1 1 ans
N, M = [int(x) for x in input().split()]
Like = [0 for _ in range(M+1)]
for i in range(N):
  KA = [int(x) for x in input().split()]
  for j in range(1, KA[0]+1):
    Like[KA[j]] += 1
ans = 0
for i in range(M+1):
  if(Like[i]==N):
    ans += 1
print(ans)