Steps for a test case in the Test Plan module are stored in the DESSTEPS table for the project. If the step is a call to another test, then in the DESSTEPS table that step will have a value in the DS_LINK_TEST field. That value will be the Test ID for the called (template) test.
General Test information is stored in the TEST table. If a Test Case has been flagged as a Template, then in the TEST table that test will have the value "Y" in the TS_TEMPLATE field.
You could construct a query based on this information to get
- the list of Tests marked as Templates
- the complete list of Call To Test design steps for each of the Template Tests, including the Test that is making the Call
From that you can derive the counts you want.