Then a simple:

Code:
on *:input:#:{ inc %ty $count($1-,ty) }


Will be sufficient smile