#include <iostream>
#include<string>
using namespace std;
int check(string a){
int sum = 0, i = 0;
for (i = 0; i < a.length(); i++){
sum += a[i] - 64;}
return sum;}
int main(){
string input;
int i, j;
bool eng = true;
while (getline(cin, input)){
eng = true;
if (input == "0"){
break;}
for (i = 0; i < input.length(); i++){
if (input[i] >= 'A' && input[i] <= 'Z'){
continue;}
else if (input[i] >= 'a' && input[i] <= 'z'){
input[i] -= 32;}
else{
eng = false;
break;}
}
if (eng){cout << check(input) << endl;}
else{cout << "Fail" << endl;}
}
}
所以我說
genshinimpact(原神)
138
chuunibyou(中二病)
139
determination(決心)
147
有態度算甚麼?
Scaramouche(散兵)107:把頭低下!