Were M3 and M5 produced by M4 , executive produced by a art director , and written by a director of M1 and M2
SELECT count(*) WHERE {
?x0 a ns:film.film_art_director .
?x1 ns:film.director.film M1 .
?x1 ns:film.director.film M2 .
M3 ns:film.film.executive_produced_by ?x0 .
M3 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M3 ns:film.film.written_by ?x1 .
M5 ns:film.film.executive_produced_by ?x0 .
M5 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M5 ns:film.film.written_by ?x1
}