Did a screenwriter marry M1 , M2 , and M3 and marry M4 's star and cinematographer
SELECT count(*) WHERE {
?x0 a ns:film.writer .
?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 ?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 M1 .
?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 M2 .
?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 .
?x1 ns:film.actor.film/ns:film.performance.film M4 .
?x1 ns:film.cinematographer.film M4 .
FILTER ( ?x0 != ?x1 ) .
FILTER ( ?x0 != M1 ) .
FILTER ( ?x0 != M2 ) .
FILTER ( ?x0 != M3 )
}