#include <stdio.h> #include <string.h> //abc def ghi jkl mno pqrs tuv wxyz //123 123 123 123 123 1234 123 1234 struct alpha{ int area; int times; }; int main() { struct alpha list[26]; list[0].area = 1, list[0].times = 1; //a list[1].area = 1, list[1].times = 2; //b list[2].area = 1, list[2].times = 3; //c list[3].area = 2, list[3].times = 1; //d list[4].area = 2, list[4].times = 2; //e list[5].area = 2, list[5].times = 3; //f list[6].area = 3, list[6].times = 1; //g list[7].area = 3, list[7].times = 2; //h list[8].area = 3, list[8].times = 3; //i list[9].area = 4, list[9].times = 1; //j list[10].area = 4, list[10].times = 2; //k list[11].area = 4, list[11].times = 3; //l list[12].area = 5, list[12].times = 1; //m list[13].area = 5, list[13].times = 2; //n list[14].area = 5, list[14].times = 3; //o list[15].area = 6, list[15].times = 1; //p list[16].area = 6, list[16].times = 2; //q list[17].area = 6, list[17].times = 3; //r list[18].area = 6, list[18].times = 4; //s list[19].area = 7, list[19].times = 1; //t list[20].area = 7, list[20].times = 2; //u list[21].area = 7, list[21].times = 3; //v list[22].area = 8, list[22].times = 1; //w list[23].area = 8, list[23].times = 2; //x list[24].area = 8, list[24].times = 3; //y list[25].area = 8, list[25].times = 4; //z char s[102]; while(scanf("%s", s) != EOF) { int res = list[s[0] - 'a'].times; for(int i = 1; i < strlen(s); i++) { if(list[s[i] - 'a'].area == list[s[i - 1] - 'a'].area) res += 2; res += list[s[i] - 'a'].times; } printf("%d\n", res); } return 0; }