Was M0 's writer influenced by a spouse of M3 , influenced by a screenwriter , and influenced by M1
SELECT count(*) WHERE {
?x0 ns:film.writer.film M0 .
?x0 ns:influence.influence_node.influenced_by ?x1 .
?x0 ns:influence.influence_node.influenced_by ?x2 .
?x0 ns:influence.influence_node.influenced_by M1 .
?x1 a ns:film.writer .
?x2 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 .
FILTER ( ?x2 != M3 )
}