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.
examples
input
copy
4 of week
output
52
input
copy
30 of month
output
11
note
polar bears use the gregorian calendar. it is the most common calendar and you likely use it too. you can read about it on wikipedia if you want to – /wiki/gregorian_calendar. the week starts with monday.
in the first sample limak wants to save one candy on each thursday (the 4-th day of the week). there are 52 thursdays in the 2016. thus, he will save 52 candies in total.
in the second sample limak wants to save one candy on the 30-th day of each month. there is the 30-th day in exactly 11 months in the 2016 — all months but february. it means that limak will save 11 candies in total.
------------------依次判断即可;
标签: