Implement string count compression