import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] key = {
                1, 2, 3,
                1, 2, 3,
                1, 2, 3,
                1, 2, 3,
                1, 2, 3,
                1, 2, 3, 4,
                1, 2, 3,
                1, 2, 3, 4
        };
        while (scanner.hasNext()) {
            char[] chars = scanner.nextLine().toCharArray();
            int count = key[chars[0] - 'a'];
            for (int i = 1; i < chars.length; i++) {
                if (chars[i] - chars[i - 1] == key[chars[i] - 'a'] - key[chars[i - 1] - 'a']) {
                    count += 2;
                }
                count += key[chars[i] - 'a'];
            }
            System.out.println(count);

        }
    }
}