Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- unsigned long long n;
- string str;
- char pl;
- cin>>str;
- pl=str[str.length()-1];
- str.resize (str.size () - 1);
- stringstream(str) >> n;
- unsigned long long ans=0;
- if((n-1)%4==0 || (n-1)%4==2)
- ans=((n-1)/4)*4+((n-1)/4)*12;
- else
- ans=((n-1)/4)*4+1+((n-1)/4)*12+ 6;
- if(pl=='a') ans+=4;
- else if(pl=='b') ans+=5;
- else if(pl=='c') ans+=6;
- else if(pl=='d') ans+=3;
- else if(pl=='e') ans+=2;
- else ans+=1;
- cout<<ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement