Letters between two letters Write a program that accepts a single lowercase word as input and outputs the number of pairs of letters that have the same number of letters between them in the word as in the alphabet.

For example, in the word 'nature', we have 4 pairs:


nr: since there are three letters between them inside the word (a, t, u) and three letters between them in the alphabet (o, p, q)
ae: since there are three letters between them inside the word (t, u, r) and three letters between them in the alphabet (b, c, d)
tu:  since there are no letters between them inside the word and no letters between them in the alphabet
tr:  since there is one letter between them inside the word (u) and one letter between them in the alphabet (s)


Since there are four pairs, the output in this case should be 4.
Pyth, 19 bytes

lfqF-MSMCT.cCUBCMz2


Try it online: Demonstration

Explanation:

lfqF-MSMCT.cCUBCMz2
                 z   read a string from input
               CM    convert into list of ascii-values
            CUB      create a list of pairs (ascii-value, index in string)
          .c      2  all combinations of length 2
 f                   filter for combinations T, which satisfy:
        CT              transpose T ((ascii1, ascii2), (index1, index2)
      SM                sort each list
    -M                  create the the difference for each
  qF                    check if they are equal
l                    print the number of remaining combinations