Was M3 written by M4 , produced by M5 , and directed by a actor of M0 , M1 , and M2
SELECT count(*) WHERE {
?x0 ns:film.actor.film/ns:film.performance.character M0 .
?x0 ns:film.actor.film/ns:film.performance.character M1 .
?x0 ns:film.actor.film/ns:film.performance.character M2 .
M3 ns:film.film.directed_by ?x0 .
M3 ns:film.film.produced_by|ns:film.film.production_companies M5 .
M3 ns:film.film.written_by M4
}