#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{char b[200];int t=0;
cin.getline(b,200,'\n') ;
for(int i=0;i<strlen(b);i++){
if(b[i]>='a'&&b[i]<='o') {
t=t+(b[i]-'a')%3+1;
}
else if(b[i]>='p'&&b[i]<='s') t=t+b[i]-'p'+1;
else if(b[i]>='t'&&b[i]<='v') t+=b[i]-'t'+1;
else if (b[i]>='w'&&b[i]<='z') t+=b[i]-'w'+1;
else if(b[i]==' ') t+=1;
}
cout<<t;
return 0;
}