Were M5 and M6 influenced by a screenwriter that married M2 , M3 , and M4 and influenced by M0 's director
SELECT count(*) WHERE {
?x0 ns:film.director.film M0 .
?x1 a ns:film.writer .
?x1 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses M2 .
?x1 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses M3 .
?x1 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses M4 .
FILTER ( ?x1 != M2 ) .
FILTER ( ?x1 != M3 ) .
FILTER ( ?x1 != M4 ) .
M5 ns:influence.influence_node.influenced_by ?x0 .
M5 ns:influence.influence_node.influenced_by ?x1 .
M6 ns:influence.influence_node.influenced_by ?x0 .
M6 ns:influence.influence_node.influenced_by ?x1
}