Use a separate counting function.