How many {lakes on river} are to/by {Lake Tanganyika} ?
How many lakes or rivers are by Lake Tanganyika?
SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P469 wd:Q5511 }
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/P469> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q5511 .
} 

Which is the number of lakes or rivers by Lake Tanganyika?