#include <iostream>
using namespace std;
int main(){
char n;
cin>>n;
char small[]={'a','b','c','d','e','f','g',
'h','i','j','k','l','m','n',
'o','p','q','r','s','t',
'u','v','w','x','y','z'};
char big[]={'A','B','C','D','E','F','G',
'H','I','J','K','L','M','N',
'O','P','Q','R','S','T',
'U','V','W','X','Y','Z'};
for (int i=0;i<=25;i++) if (small[i]==n) cout<<i+1;
for (int i=0;i<=25;i++) if (big[i]==n) cout<<i+1;
return 0;
}