#include<stdio.h>
int main()
{
int month, year;
scanf_s("%d-%d",&year, &month);
switch (month){
case 2:if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
{
printf("29天");
}
else printf("28天");
break;
case 4:
case 6:
case 9:
case 11:printf("30天"); break;
default:printf("31天");
}
}