Were M3 and M5 edited by M2 's actor , written by a Spanish film director , and produced by M4
SELECT count(*) WHERE {
?x0 a ns:film.director .
?x0 ns:people.person.nationality ns:m.06mkj .
?x1 ns:film.actor.film/ns:film.performance.character M2 .
M3 ns:film.film.edited_by ?x1 .
M3 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M3 ns:film.film.written_by ?x0 .
M5 ns:film.film.edited_by ?x1 .
M5 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M5 ns:film.film.written_by ?x0
}