#include <iostream> #include <cstdio> using namespace std; 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 }; int main(){ string s; while(cin >> s){ int time = 0; for(int i = 0;i < s.size();i ++){ time += keytab[s[i] - 'a']; if(i != 0 && s[i] - s[i - 1] == keytab[s[i] - 'a'] - keytab[s[i - 1] - 'a']){ time += 2; } } cout << time << endl; } return 0; }