Were M3 and M5 directed by a writer of M0 and M1 , directed by a film producer , and written by M4
SELECT count(*) WHERE {
?x0 ns:film.writer.film M0 .
?x0 ns:film.writer.film M1 .
?x1 a ns:film.producer .
M3 ns:film.film.directed_by ?x0 .
M3 ns:film.film.directed_by ?x1 .
M3 ns:film.film.written_by M4 .
M5 ns:film.film.directed_by ?x0 .
M5 ns:film.film.directed_by ?x1 .
M5 ns:film.film.written_by M4
}