How many {head of state} are to/by {Emil Constantinescu} ?
What is the number of times that Emil Constantinescu was head of state?
How many times was Emil Constantinescu head of state?
SELECT ( COUNT ( ?p ) AS ?y ) { ?p property:head_of_state resource:Emil_Constantinescu }
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/P35> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q299152 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P35 wd:Q299152 }
3