Were M2 and M3 directed by a film 's writer and producer and written by M0 's star
SELECT count(*) WHERE {
?x0 ns:film.actor.film/ns:film.performance.film M0 .
?x1 ns:film.producer.film|ns:film.production_company.films ?x2 .
?x1 ns:film.writer.film ?x2 .
?x2 a ns:film.film .
M2 ns:film.film.directed_by ?x1 .
M2 ns:film.film.written_by ?x0 .
M3 ns:film.film.directed_by ?x1 .
M3 ns:film.film.written_by ?x0
}