Was M1 written by a spouse of a film 's editor and executive producer and produced by M2 and M3
SELECT count(*) WHERE {
?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 .
?x1 ns:film.editor.film ?x2 .
?x1 ns:film.producer.films_executive_produced ?x2 .
?x2 a ns:film.film .
FILTER ( ?x0 != ?x1 ) .
M1 ns:film.film.produced_by|ns:film.film.production_companies M2 .
M1 ns:film.film.produced_by|ns:film.film.production_companies M3 .
M1 ns:film.film.written_by ?x0
}