stack: add count operation