Did M4 star a male person 's spouse and star M0 's Japanese writer
SELECT count(*) WHERE {
?x0 ns:film.writer.film M0 .
?x0 ns:people.person.nationality ns:m.03_3d .
?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 .
?x2 ns:people.person.gender ns:m.05zppz .
FILTER ( ?x1 != ?x2 ) .
M4 ns:film.film.starring/ns:film.performance.actor ?x0 .
M4 ns:film.film.starring/ns:film.performance.actor ?x1
}