Was M3 produced by a film 's Spanish writer and directed by a producer , director , and writer of M2
SELECT count(*) WHERE {
?x0 ns:film.writer.film ?x1 .
?x0 ns:people.person.nationality ns:m.06mkj .
?x1 a ns:film.film .
?x2 ns:film.director.film M2 .
?x2 ns:film.producer.film|ns:film.production_company.films M2 .
?x2 ns:film.writer.film M2 .
M3 ns:film.film.directed_by ?x2 .
M3 ns:film.film.produced_by|ns:film.film.production_companies ?x0
}