Were M3 and M5 produced by M4 and written by a Spanish male costume designer
SELECT count(*) WHERE {
?x0 a ns:film.film_costumer_designer .
?x0 ns:people.person.gender ns:m.05zppz .
?x0 ns:people.person.nationality ns:m.06mkj .
M3 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M3 ns:film.film.written_by ?x0 .
M5 ns:film.film.produced_by|ns:film.film.production_companies M4 .
M5 ns:film.film.written_by ?x0
}