Was M2 distributed by M3 and produced by a film producer that wrote M1
SELECT count(*) WHERE {
?x0 a ns:film.producer .
?x0 ns:film.writer.film M1 .
M2 ns:film.film.distributors/ns:film.film_film_distributor_relationship.distributor M3 .
M2 ns:film.film.produced_by|ns:film.film.production_companies ?x0
}