Skip to content

Instantly share code, notes, and snippets.

@avamsi
Created November 23, 2014 08:11
Show Gist options
  • Select an option

  • Save avamsi/87b364de8b5add2251b8 to your computer and use it in GitHub Desktop.

Select an option

Save avamsi/87b364de8b5add2251b8 to your computer and use it in GitHub Desktop.
f = []
ff = set([])
for _ in xrange(int(raw_input())):
i = raw_input().split()
f.append(i[0])
ff = ff.union(set(i[2: ]))
for i in f:
try:
ff.remove(i)
except KeyError:
pass
print len(ff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment