import sys for line in sys.stdin: y,m = map(int,line.split()) if m in [1,3,5,7,8,10,12]: print(31) elif m in [4,6,9,11]: print(30) else: if y%400==0&nbs***bsp;(y%4==0 and y%100!=0): print(29) else: print(28)
# 运用了字典
day=0
while True:
try:
year,month=map(int,input().split())
if (year%4==0 and year%100!=0)&nbs***bsp;year%400==0:
if month==2:
day=29
else:
if month==2:
day=28
dic={1:31,2:day,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}
print(dic[month])
except:
break
while True:
try:
year,month=map(int,input().split())
if year%400==0&nbs***bsp;(year%4==0 and year%100!=0):
if month==2:
print('29')
if month==1&nbs***bsp;month ==3&nbs***bsp;month==5&nbs***bsp;month==7&nbs***bsp;month==8&nbs***bsp;month==10&nbs***bsp;month==12:
print('31')
if month==4&nbs***bsp;month==6&nbs***bsp;month==9&nbs***bsp;month==11:
print('30')
else:
if month==2:
print('28')
if month==1&nbs***bsp;month ==3&nbs***bsp;month==5&nbs***bsp;month==7&nbs***bsp;month==8&nbs***bsp;month==10&nbs***bsp;month==12:
print('31')
if month==4&nbs***bsp;month==6&nbs***bsp;month==9&nbs***bsp;month==11:
print('30')
except:
break