How many {head of government} are to/by {Andrew Fisher} ?
How many governments is Andrew Fisher head of?
Andrew Fisher is the head of how many governments?
SELECT ( COUNT ( ?f ) AS ?r ) { ?f property:head_of_government resource:Andrew_Fisher }
SELECT (COUNT(?sub) AS ?subs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?sub .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P6> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q314016 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P6 wd:Q314016 }
3