K.FC: Foundations of Counting