#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
int t[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 s[101];
while(cin>>s){
int sum=0;
char last;
for(int i=0;i<strlen(s);i++){
sum+=t[s[i]-'a'];
if(last+t[s[i]-'a']==s[i]&&i>0)
sum+=2;
last=s[i]-t[s[i]-'a'];
}
cout<<sum<<endl;
}
return 0;
}
// abc def
//ghi jkl mno
//pqrs tuv wxyz
02-13
2022
01-04
3884