SELECT (COUNT(*) AS ?x) WHERE { ?s ?p ?o } GROUP BY ?x