Counting Distance Permutations