Was M3 written by a film director that M0 was produced by , M2 was directed by , and M1 starred
SELECT count(*) WHERE {
?x0 ns:film.actor.film/ns:film.performance.film M1 .
?x0 ns:film.director.film M2 .
?x0 ns:film.producer.film|ns:film.production_company.films M0 .
M3 ns:film.film.written_by ?x0
}