计算字符出现次数