#include <iostream>
using namespace std;
int Char[26] = { 1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,8,8 };//在数字几
int No[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 };//数字几的第几个
int main() {
    string str;
    while (cin >> str) { // 注意 while 处理多个 case
        int sum = 0;
        sum += No[str[0] - 'a'];
        for (int i = 1; i < str.size(); ++i) {
            if (Char[str[i] - 'a'] == Char[str[i-1]-'a']) {
                sum += 2;
            }
            sum += No[str[i] - 'a' ];
        }
        cout << sum << endl;
    }
}
// 64 位输出请用 printf("%lld")