Was M2 produced by M3 , M4 , and M5 , produced by a character , and written by M0 's writer
SELECT count(*) WHERE {
?x0 ns:film.writer.film M0 .
?x1 a ns:fictional_universe.fictional_character .
M2 ns:film.film.produced_by|ns:film.film.production_companies ?x1 .
M2 ns:film.film.produced_by|ns:film.film.production_companies M3 .
M2 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M2 ns:film.film.produced_by|ns:film.film.production_companies M5 .
M2 ns:film.film.written_by ?x0
}