#include<iostream>

char*m="02210313074020029000033739";
int f(char*p){int n=0;while(*p)n+=m[*p++-65]-47;return n;}

int main() {
	std::cout << f("ABC") << std::endl;
	std::cout << f("PPCG") << std::endl;
	std::cout << f("STEWIE") << std::endl;
	std::cout << f("FIZZBUZZ") << std::endl;
	std::cout << f("ABCDEFGHIJKLMNOPQRSTUVWXYZ") << std::endl;
	return 0;
}