Define nitems() to count container size