Character counting from input