Was a film 's producer a Canadian screenwriter that M1 and M2 influenced and M4 and M5 married
SELECT count(*) WHERE {
?x0 a ns:film.writer .
?x0 ns:film.producer.film|ns:film.production_company.films ?x1 .
?x0 ns:influence.influence_node.influenced_by M1 .
?x0 ns:influence.influence_node.influenced_by M2 .
?x0 ns:people.person.nationality ns:m.0d060g .
?x0 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 .
?x0 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses M5 .
?x1 a ns:film.film .
FILTER ( ?x0 != M4 ) .
FILTER ( ?x0 != M5 )
}