#include <stdio.h>
int main()
{
int weight,height,age;
float MBMR,FBMR,amount;
char M,F,sex;
scanf("%d %d %d %c",&height,&weight,&age,&sex);
FBMR=655+(4.3*weight*2.2)+(4.7*height*0.39)-(4.7*age);
MBMR=66+(6.3*weight*2.2)+(12.9*height*0.39)-(6.8*age);
if(sex=='F'){
amount=FBMR/230.0;
printf("您需要消耗%.2f块巧克力\n",amount);
}else if(sex=='M')
amount=MBMR/230.0;
printf("您需要消耗%.2f块巧克力\n",amount);
return 0;
}