//关键在于:同一按键的字母之差等于对应按键次数之差
#include<bits/stdc++.h>
using namespace std;int key[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(){
char s[101];
int time;
while(cin>>s){
time=0;
for(int i=0;s[i]!='\0';i++)time+=key[s[i]-'a']; //按键时间
for(int i=0;s[i+1]!='\0';i++)
if((s[i]-s[i+1])==(key[s[i]-'a']-key[s[i+1]-'a']))time+=2; //等待时间
cout<<time<<endl;
}
return 0;
}