Did M3 star a person 's spouse and star a American director and writer of M0
SELECT count(*) WHERE {
?x0 ns:film.director.film M0 .
?x0 ns:film.writer.film M0 .
?x0 ns:people.person.nationality ns:m.09c7w0 .
?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 a ns:people.person .
FILTER ( ?x1 != ?x2 ) .
M3 ns:film.film.starring/ns:film.performance.actor ?x0 .
M3 ns:film.film.starring/ns:film.performance.actor ?x1
}