Calculate the sum of column counts once