What operations do you have available? If you can only use push, pop, and empty then you're stuck with removing every item until the stack is empty and counting them. Any decent stack implementation will provide you with some form of size operation that will tell you how many items there are, so you need to be more specific.
>empty auxiliary stacks are available.
Getting information out of you people is like pulling teeth. Did you know that? I'll assume that you can only use push, pop, and empty. In that case, pop every item in the stack, increment a counter and push that item onto a second stack. When the first stack is empty, do the reverse but don't increment the counter and you'll have the same stack that you started with.