Add support for counting linked list elements