We can display the total number all posts or in particular with following code , I have used only one curly brace, make sure there are two

{ site.posts | size }

To display count number for particular categories:

{ site.categories.CAT | size }