Count and identity functions