Add a sample code for fast element counting