weighted sum of counter