#include <stdio.h>
#include <string.h>
int main()
{
int c, sum = 0;
char *s = ".,! ";
while ((c = getc(stdin)) >= 32)
if ('a' <= c && c <= 'z')
sum += (c - 'a') % 3 + 1;
else
sum += (strchr(s, c) - s) % 3 + 1;
printf("%d\n", sum);
return 0;
}