My parents have an home theater device. The remote is broken making it incredibly difficult to navigate rightwards in a menu. Most the time it doesn't work but when it does it moves rightwards incredibly quickly.
This is obviously frustrating but it is most frustrating when you want to enter a movie title which requires navigating a keyboard that looks like this:
a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 0
Your task is to take as input a movie title and calculate how "frustrating" it is to type that movie title. The frustration number of a particular string is the number of letters that require moving right from the letter before them. We don't care how far right they are, since if we start moving right we pretty much instantly go to the end of the line, and we don't care about up, down or leftwards movement because they are easy.
For example if we wanted to type in
- We start at
eis just above
kso we don't need to move right.
yis all the way left so no need to move right.
bhowever is on the next column rightwards so we need to move right to get to it.
ois on the next column over so we have to move rightwards to get to it.
ais back in the first column so we move left to get to it.
ris all the way on the right so we move right to it.
dis two columns to the left of
The characters that need to move to the right are
bor meaning that this is frustration 3.
This is a code-golf challenge so your answers will be scored in bytes with fewer bytes being better. The input will always consist of alphanumeric characters, you can support either capital or lowercase letters and you only need to support one. The input will never be empty.
keyboard -> 3 2001aspaceodyssey -> 6 sorrytobotheryou -> 8 thinblueline -> 5 blast2 -> 3