Count minimal number of jumps from position X to Y.