151
 Code:
function a($)
  dim $r
  $r=cai,aop,oic,ipa,pco 
  $a=substr($,instr($,",")+2,1)
  $=substr($,2,1)
  for each $r in $r
    if left($r,1)=$
      $a=2-(instr($r,$a)>1)-($=$a)*2
	;endif
  ;next
endfunction