Skip to content

Instantly share code, notes, and snippets.

file_name = input()
fin = open(file_name, 'r')
text = fin.readlines()
dictionary = {}
for str in text:
for word in str.split():
try:
dictionary[word] = dictionary[word] +1
except KeyError:
dictionary[word] = 1
s = input()
print (len( set( s.split())))