Description
Today is Wednesday, the third day of the week. What's more interesting is that tomorrow is the last day of the year 2015.
Limak is a little polar bear. He enjoyed this year a lot. Now, he is so eager to the coming year 2016.
Limak wants to prove how responsible a bear he is. He is going to regularly save candies for the entire year 2016! He considers various saving plans. He can save one candy either on some fixed day of the week or on some fixed day of the month.
Limak chose one particular plan. He isn't sure how many candies he will save in the 2016 with his plan. Please, calculate it and tell him.
Input
The only line of the input is in one of the following two formats:
- "x of week" where x (1 ≤ x ≤ 7) denotes the day of the week. The 1-st day is Monday and the 7-th one is Sunday.
- "x of month" where x (1 ≤ x ≤ 31) denotes the day of the month.
Output
Print one integer — the number of candies Limak will save in the year 2016.
Sample Input
Input
4 of week
Output
52
Input
30 of month
Output
11
#include<stdio.h>
#include<string.h>
int main()
{
char d[32];
int a,c,k;
while(~scanf("%d of %s",&a,d))
{
if(d[0]!='w')
{
if(a>=1&&a<=29)
k=12;
else if(a==30)
k=11;
else k=7;
}
else
{
if(a==5||a==6)
k=53;
else k=52;
}
printf("%d\n",k);
}
return 0;
}