Were M2 and M5 produced by a Spanish screenwriter , written by M3 , and produced by M4
SELECT count(*) WHERE {
?x0 a ns:film.writer .
?x0 ns:people.person.nationality ns:m.06mkj .
M2 ns:film.film.produced_by|ns:film.film.production_companies ?x0 .
M2 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M2 ns:film.film.written_by M3 .
M5 ns:film.film.produced_by|ns:film.film.production_companies ?x0 .
M5 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M5 ns:film.film.written_by M3
}