Correct count calculation