#include<iostream>
#include<map>
#include<string>
using namespace std;
int main(){
std::map<char,int> jianpan={{'a',1},{'b',1},{'c',1},{'d',2},{'e',2},{'f',2},{'g',3},{'h',3},{'i',3},{'j',4},{'k',4},{'l',4},{'m',5},{'n',5},{'o',5},{'p',6},{'q',6},{'r',6},{'s',6},{'t',7},{'u',7},{'v',7},{'w',8},{'x',8},{'y',8},{'z',8}};
std:map<char,int> shunxu={{'a',1},{'b',2},{'c',3},{'d',1},{'e',2},{'f',3},{'g',1},{'h',2},{'i',3},{'j',1},{'k',2},{'l',3},{'m',1},{'n',2},{'o',3},{'p',1},{'q',2},{'r',3},{'s',4},{'t',1},{'u',2},{'v',3},{'w',1},{'x',2},{'y',3},{'z',4}};
string s;
while(cin>>s){
int sum=shunxu[s[0]];
for(int i=1;i<s.length();i++){
if(jianpan[s[i]]==jianpan[s[i-1]])
sum=sum+2+shunxu[s[i]];
else
sum=sum+shunxu[s[i]];
}
cout<<sum<<endl;
}
}