Were M4 and M5 written by a French cinematographer of M1 and M2 and produced by M3 's spouse
SELECT count(*) WHERE {
?x0 ns:film.cinematographer.film M1 .
?x0 ns:film.cinematographer.film M2 .
?x0 ns:people.person.nationality ns:m.0f8l9c .
?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 M3 .
FILTER ( ?x1 != M3 ) .
M4 ns:film.film.produced_by|ns:film.film.production_companies ?x1 .
M4 ns:film.film.written_by ?x0 .
M5 ns:film.film.produced_by|ns:film.film.production_companies ?x1 .
M5 ns:film.film.written_by ?x0
}