$nick($chan,0) will return the total number of users.
You can also break it down by users of each class (op, voice, etc). Try this one out.
That'll show something like @4+13/76, which is @(ops) +(voices) /(total)
/help $nick for more info.