What are all different template ids used for documents, and how many times were each of them used?
return documents ;return template ids used  for #1 ;return the  different #2 ;return number of  #1 for each of #3 ;return #3 ,  #4
['select', 'project', 'project', 'group', 'union']