You should put your AFNI binaries directory ~/abin FIRST in your path, which will help avoid problems like this.
Historical aside: program "count" was written before I ever thought of AFNI, for help in scripting. When I first started at MCW, I was appalled that everyone was manually writing out the filenames like X001, X002, ... X093, and then changing them manually for the next analysis. I can't take tedium like that, so wrote the earliest version of count very soon after starting at MCW in 1993.