get taxonomy term count by vid
I don't have a D5 system handy, but this would do it in D6:

$count=0;
foreach ($node-&gt;taxonomy as $t) {
  if ($t-&gt;vid==VID_IN_QUESTION) {
    $count++;
  }
}


and it "should" be the same in D5, but I've said that a lot about D7 and D6 :)  If not,

drupal_set_message('&lt;pre&gt;' . print_r($node-&gt;taxonomy,true) . '&lt;/pre&gt;');


should give you the object information you need to modify above to count.  If that doesn't work, 

$foo=taxonomy_node_get_terms_by_vocabulary($nid, $vid);
$count=count($foo);


certainly is a roundabout way of getting them if you already have the node loaded.