#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<=(b);++i)
#define REPD(i,a,b) for(int i=a;i>=(b);--i)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
typedef long long LL;
int main(int argc, char const *argv[])
{
LL a;char ch;
const char p[]=" fedabc";
scanf("%I64d%c",&a,&ch);
a--;
LL n=a/4*2+(a&1);
LL m=n/2*4+(n&1);
printf("%I64d\n", n*6+m+(find(p,p+7,ch)-p));
return 0;
}
Canada Cup 2016 B. Food on the Plane 找规律 .
最新推荐文章于 2020-10-08 10:03:51 发布