#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
    int Arr[26] = {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};
    char str[100];
    while ((scanf("%s", str)) != EOF) {
        int number = 0;
        for (int i = 0; str[i] != '\0'; i++) {
            int j = str[i] - 'a';
            number += Arr[j];
            if (i > 0) {
                int k = str[i - 1] - 'a';
                if ((str[i] - str[i - 1]) == (Arr[j] - Arr[k]))
                {
                    number += 2;
                }
            }
        }
        printf("%d\n", number);
    }
    return 0;
}