I think you're close Doug: funnily I can't find a number in any of the books to hand, even Douglas books. A couple suggested "about 25,000".
My ridiculously precise number comes a fascinating table in the Olyslager Auto Library book "Motorcycle to 1945". It clearly comes form an official source as it lists the complete inventory of motorcycles and sidecars in possession of the British Armed Forces at the Armistice in 1918.
For the record, the Douglas figures are: Overseas: 9,515, At home: 8,800, Total in service: 18,315, including 13,477 2 3/4 hp solo and 4,816 4-hp combinations.
The total number of Triumphs was 17,998.