#include <stdio.h>
#include <stdlib.h>
int main()
{
int year,month;
scanf("%d %d",&year,&month);
if(year%4==0)
{
if(month==2)
{
printf("%d",29);
}
else
{
if(month==4||month==6||month==9||month==11)
printf("%d",30);
else
printf("%d",31);
}
}
else if(month==2)
{
printf("%d",28);
}
else
{
if(month==4||month==6||month==9||month==11)
{
printf("%d",30);
}
else
{
printf("%d",31);
}
}
return 0;
}
#include <stdlib.h>
int main()
{
int year,month;
scanf("%d %d",&year,&month);
if(year%4==0)
{
if(month==2)
{
printf("%d",29);
}
else
{
if(month==4||month==6||month==9||month==11)
printf("%d",30);
else
printf("%d",31);
}
}
else if(month==2)
{
printf("%d",28);
}
else
{
if(month==4||month==6||month==9||month==11)
{
printf("%d",30);
}
else
{
printf("%d",31);
}
}
return 0;
}