If the tokenize string is tokenized using $chr(1) (/tokenize 1 <string>) then $0 will return the amount of parameters, otherwise $gettok(<string>,0,1) will do it.