count color pairs - stacks