Were M3 and M5 executive produced by a person that M1 and M2 influenced and written by M4
SELECT count(*) WHERE {
?x0 a ns:people.person .
?x0 ns:influence.influence_node.influenced_by M1 .
?x0 ns:influence.influence_node.influenced_by M2 .
M3 ns:film.film.executive_produced_by ?x0 .
M3 ns:film.film.written_by M4 .
M5 ns:film.film.executive_produced_by ?x0 .
M5 ns:film.film.written_by M4
}