Did a actor write M3 's sequel , executive produce M2 , and write M1
SELECT count(*) WHERE {
?x0 a ns:film.actor .
?x0 ns:film.producer.films_executive_produced M2 .
?x0 ns:film.writer.film ?x1 .
?x0 ns:film.writer.film M1 .
?x1 ns:film.film.prequel M3
}