Did a screenwriter whose country of nationality employed M5 influence M1 and M2 and marry M3 and M4
SELECT count(*) WHERE {
?x0 a ns:film.writer .
?x0 ns:influence.influence_node.influenced M1 .
?x0 ns:influence.influence_node.influenced M2 .
?x0 ns:people.person.nationality ?x1 .
?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 M3 .
?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 .
?x1 ns:business.employer.employees/ns:business.employment_tenure.person M5 .
FILTER ( ?x0 != M3 ) .
FILTER ( ?x0 != M4 )
}