You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
def f(d,e,f):
|
|
a,b=*map(int,d.split('-'))
|
|
return (f[a-1]==e[0])^(f[b-1]==e[0])
|
|
print(sum(f(*x.split())for x in open(0)))
|