Word & character count implementation