Were M3 and M5 directed by a writer of M1 and M2 , edited by M4 , and edited by M0 's actor
SELECT count(*) WHERE {
?x0 ns:film.actor.film/ns:film.performance.character M0 .
?x1 ns:film.writer.film M1 .
?x1 ns:film.writer.film M2 .
M3 ns:film.film.directed_by ?x1 .
M3 ns:film.film.edited_by ?x0 .
M3 ns:film.film.edited_by M4 .
M5 ns:film.film.directed_by ?x1 .
M5 ns:film.film.edited_by ?x0 .
M5 ns:film.film.edited_by M4
}