counting liberites and connected stones work.