Were M1 and M4 produced by M2 and M3 and written by a production company 's employee 's child 's parent
SELECT count(*) WHERE {
?x0 ns:people.person.children|ns:fictional_universe.fictional_character.children|ns:organization.organization.child/ns:organization.organization_relationship.child ?x1 .
?x1 ns:people.person.parents|ns:fictional_universe.fictional_character.parents|ns:organization.organization.parent/ns:organization.organization_relationship.parent ?x2 .
?x2 ns:people.person.employment_history/ns:business.employment_tenure.company ?x3 .
?x3 a ns:film.production_company .
M1 ns:film.film.produced_by|ns:film.film.production_companies M2 .
M1 ns:film.film.produced_by|ns:film.film.production_companies M3 .
M1 ns:film.film.written_by ?x0 .
M4 ns:film.film.produced_by|ns:film.film.production_companies M2 .
M4 ns:film.film.produced_by|ns:film.film.production_companies M3 .
M4 ns:film.film.written_by ?x0
}