Were M3 and M4 edited by a writer of M2 and produced by a Spanish person
SELECT count(*) WHERE {
?x0 a ns:people.person .
?x0 ns:people.person.nationality ns:m.06mkj .
?x1 ns:film.writer.film M2 .
M3 ns:film.film.edited_by ?x1 .
M3 ns:film.film.produced_by|ns:film.film.production_companies ?x0 .
M4 ns:film.film.edited_by ?x1 .
M4 ns:film.film.produced_by|ns:film.film.production_companies ?x0
}