Simple word and letter counter written in C++