Two things:

1. You should initialize numtimes to 0 before you use it
2. Compare word[i] to letter[0]