Were M1 and M4 written by M2 , written by M3 , and written by a employee of a film producer
SELECT count(*) WHERE {
?x0 ns:people.person.employment_history/ns:business.employment_tenure.company ?x1 .
?x1 a ns:film.producer .
M1 ns:film.film.written_by ?x0 .
M1 ns:film.film.written_by M2 .
M1 ns:film.film.written_by M3 .
M4 ns:film.film.written_by ?x0 .
M4 ns:film.film.written_by M2 .
M4 ns:film.film.written_by M3
}