#include <iostream>

using namespace std;

int main() {
    int keyTab[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};
    string str;
    while (cin >> str) {
        int time = 0;
        for (int i = 0; i < str.size(); i++) { //此处为str.size()
            time += keyTab[str[i] - 'a'];
            if (i != 0 &&
                    str[i] - str[i - 1] == keyTab[str[i] - 'a'] - keyTab[str[i - 1] - 'a']) {
                time += 2;
            }
        }

        cout << time << endl;
    }
}