Was M3 directed by a American star of M1 and M2 and written by M4 and M5
SELECT count(*) WHERE {
?x0 ns:film.actor.film/ns:film.performance.film M1 .
?x0 ns:film.actor.film/ns:film.performance.film M2 .
?x0 ns:people.person.nationality ns:m.09c7w0 .
M3 ns:film.film.directed_by ?x0 .
M3 ns:film.film.written_by M4 .
M3 ns:film.film.written_by M5
}