Was M3 written by and produced by a art director that M1 was played by and M2 was played by
SELECT count(*) WHERE {
?x0 a ns:film.film_art_director .
?x0 ns:film.actor.film/ns:film.performance.character M1 .
?x0 ns:film.actor.film/ns:film.performance.character M2 .
M3 ns:film.film.produced_by|ns:film.film.production_companies ?x0 .
M3 ns:film.film.written_by ?x0
}