add count() function
Merge pull request #185 from doochik/patch-3

add count() function