Declare javascript variable numPosts
This step is not absolutely necessary, but I like to declare the variables used in the whole page. Best place for this is in html head. So, edit template html, find </head> and add this before it:
<script type='text/javascript'>
var numPosts = 7;
</script>
Default value is 7 posts per page. If there is already some javascript before </head>, you can also add only the var numPosts = 7; line before the </script> tag. Something like this (highlighted line is added, others are old lines):
// ... some old code here ...
// ... some old code here ...
var numPosts = 7;
//]]>
</script>
Assign actual numPosts value in the posts widget
Ok, for this one you need to edit the html, again, and select Expand Widget Templates. Then find line:
<b:includable id='main' var='top'>
and add after that these lines:
<script type='text/javascript'>
numPosts = <data:numPosts/>;
</script>
And now we have the number of posts showing on the page in javascript variable numPosts.
Testing
To test that code works, find </body>, and add before that:
<script type='text/javascript'>
document.title = document.title + " (viewing " + numPosts + " posts)";
</script>
Again, if there is already some javascript there, before </body>, you can also add document.title... line there. Now when viewing the blog, window title should be "YourBlogName (viewing # posts), where # is the number of posts on page.