Was a sequel of M1 's sequel directed by and written by M0 's producer
SELECT count(*) WHERE {
?x0 ns:film.film.directed_by ?x1 .
?x0 ns:film.film.prequel ?x2 .
?x0 ns:film.film.written_by ?x1 .
?x1 ns:film.producer.film|ns:film.production_company.films M0 .
?x2 ns:film.film.prequel M1
}