Preprocess and store the counts into HashMap