Were M3 and M4 directed by a screenwriter , written by a film director , and executive produced by M0 's producer
SELECT count(*) WHERE {
?x0 ns:film.producer.film|ns:film.production_company.films M0 .
?x1 a ns:film.director .
?x2 a ns:film.writer .
M3 ns:film.film.directed_by ?x2 .
M3 ns:film.film.executive_produced_by ?x0 .
M3 ns:film.film.written_by ?x1 .
M4 ns:film.film.directed_by ?x2 .
M4 ns:film.film.executive_produced_by ?x0 .
M4 ns:film.film.written_by ?x1
}