Did M1 's prequel 's writer direct a prequel and sequel of a film and executive produce M0
SELECT count(*) WHERE {
?x0 ns:film.director.film ?x1 .
?x0 ns:film.producer.films_executive_produced M0 .
?x0 ns:film.writer.film ?x2 .
?x1 ns:film.film.prequel ?x3 .
?x1 ns:film.film.sequel ?x3 .
?x2 ns:film.film.sequel M1 .
?x3 a ns:film.film
}