Was M3 written by a actor , written by M2 's female art director 's spouse , and written by M4
SELECT count(*) WHERE {
?x0 a ns:film.actor .
?x1 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses ?x2 .
?x2 ns:film.film_art_director.films_art_directed M2 .
?x2 ns:people.person.gender ns:m.02zsn .
FILTER ( ?x1 != ?x2 ) .
M3 ns:film.film.written_by ?x0 .
M3 ns:film.film.written_by ?x1 .
M3 ns:film.film.written_by M4
}