added count functions
Merge pull request #2 from tapiokawaseda/master

added count functions