count in function