Was M1 directed by M3 , produced by M2 , and written by a editor of a prequel of M0 's sequel
SELECT count(*) WHERE {
?x0 ns:film.editor.film ?x1 .
?x1 ns:film.film.sequel ?x2 .
?x2 ns:film.film.prequel M0 .
M1 ns:film.film.directed_by M3 .
M1 ns:film.film.produced_by|ns:film.film.production_companies M2 .
M1 ns:film.film.written_by ?x0
}