Was M3 written by M1 's Mexican star and directed by M2 's star and producer
SELECT count(*) WHERE {
?x0 ns:film.actor.film/ns:film.performance.film M1 .
?x0 ns:people.person.nationality ns:m.0b90_r .
?x1 ns:film.actor.film/ns:film.performance.film M2 .
?x1 ns:film.producer.film|ns:film.production_company.films M2 .
M3 ns:film.film.directed_by ?x1 .
M3 ns:film.film.written_by ?x0
}