count character freqency