Was a person 's actor 's spouse 's gender M0 's gender
SELECT count(*) WHERE {
?x0 ^ns:people.person.gender ?x1 .
?x0 ^ns:people.person.gender M0 .
?x1 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses ?x2 .
?x2 ns:film.actor.film/ns:film.performance.character ?x3 .
?x3 a ns:people.person .
FILTER ( ?x1 != ?x2 )
}