How did the farmer count his herd of cattle?

He used a COWculator.