query: prefix wdt: <http://www.wikidata.org/prop/direct/>
  prefix wd: <http://www.wikidata.org/entity/>
  SELECT ?count ?timespan WHERE {
          {		SELECT (count(?item) as ?count) WHERE {
            		?item wdt:P31 wd:Q5 .
                  ?item wdt:P21 wd:Q6581072 .
    				?item wdt:P569 ?time0 .
    				(FILTER ( ?time0 >= "0001-01-01T00:00:00Z"^^xsd:dateTime && ?time0 <= "1000-01-01T00:00:00Z"^^xsd:dateTime ) as ?timespan)
          }
  UNION
          {		SELECT (count(?item) as ?count) WHERE {
            		?item wdt:P31 wd:Q5 .
                  ?item wdt:P21 wd:Q6581072 .
    				?item wdt:P569 ?time0 .
    				(FILTER ( ?time0 >= "1001-01-01T00:00:00Z"^^xsd:dateTime && ?time0 <= "1500-01-01T00:00:00Z"^^xsd:dateTime ) as ?timespan)
          }
  }