Not something I have much experience of doing myself, but I can point you in the direction of a good paper to read through on this topic, by two authors who really do know a lot about the topic :)
Estimating Synonymous and Nonsynonymous Substitution Rates Under Realistic Evolutionary Models, Yang and Nielsen, MBE 1999
This discusses some of the methods for exploring these kinds of issues that depend on counting sites, along with references to other relevant articles and discussions.
Ziheng also covers these topics in his book "Computational Molecular Evolution" (which I find a great place to begin for non-mathematics-minded people [such as myself] who want to grapple with the maths) in the second chapter (section 2.5, looking at counting methods).
It looks like the MEGA software might do this for you i.e. give you estimates of the number of sites, but if I were you, based on my faint memories of learning about these topics, I'd consider looking into doing your analyses using ML, as implemented, for example, in the codeml program within the PAML package