Dimension-agnostic move counting.