Unix $# statement
It evaluates to the number of command-line arguments passed to the script.
The best place to look to discover this kind of thing is the Bash manual. And in this particular case, you're interested in the section on special parameters. (oops, this is ksh, not Bash).