#include <iostream>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
int time = 0, i = 0;
string str;
cin >> str;
while (true) {
char a = str.at(i);
switch (a) {
case 'A':
case 'B':
case 'C':
time += 3;
break;
case 'D':
case 'E':
case 'F':
time += 4;
break;
case 'G':
case 'H':
case 'I':
time += 5;
break;
case 'J':
case 'K':
case 'L':
time += 6;
break;
case 'M':
case 'N':
case 'O':
time += 7;
break;
case 'P':
case 'Q':
case 'R':
case 'S':
time += 8;
break;
case 'T':
case 'U':
case 'V':
time += 9;
break;
case 'W':
case 'Y':
case 'X':
case 'Z':
time += 10;
}
if (i < str.size() - 1)
i++;
else break;
}
cout << time;
return 0;
}