DuXxXieJ, I'd suggest using tokens for this one, it will increase the variable even if you say "pretty" or something that has "ty" in it. This will look at your sentence and see if you have "ty" as a word.
on *:INPUT:#: {
if ($istok($1-,ty,32)) { inc %ty }
}