query: # By Tagishsimon
  SELECT ?item ?itemLabel ?country ?countryLabel (COUNT(?place) AS ?count) 
  WITH {
    SELECT ?country ?item ?howmany WHERE {
      hint:Query hint:optimizer "None".
      ?item wdt:P279 wd:Q10864048 ; wdt:P17 ?country .
      ?country wdt:P31 wd:Q3624078.
      MINUS { ?item wdt:P576 [] }
      MINUS { ?country wdt:P576 [] }
    } 
  } as %i
  WHERE {
    INCLUDE %i
    ?item ^wdt:P31/^wdt:P279* ?place .
    SERVICE wikibase:label { 
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
      ?country rdfs:label ?countryLabel .
      ?item rdfs:label ?itemLabel .
    }
  } 
  GROUP BY ?country ?countryLabel ?item ?itemLabel
  ORDER BY ?countryLabel