int main()
{
int arr[12] = { 31,28,31,30,31,30,31,30,31,30,31,30 };
int y = 0;
int m = 0;
while (scanf("%d %d", &y, &m) != EOF) //EOF返回-1
//(~scanf("%d %d), &y, &m) //~取反,如果返回EOF,补码全是32个1,~取反,全为0,即为假
//(scanf("%d %d), &y, &m) == 2
{
if ((y % 4 == 0 && y % 100 != 0 || y % 400 == 0)&&m == 2)//判断是否为闰年,且为闰年的2月
{
printf("%d\n", arr[m - 1] + 1);
}
else
{
printf("%d\n", arr[m - 1]);
}
}
return 0;
}