#!usr/bin/env python
# -*- coding:utf-8 -*-
print "*** [year:1970-2030] ***"
print ""
import calendar
i = ['1900','1901','1902','1903']
l1 = ['1','2','3','4','5','6','7','8','9','10','11','12']
n=1904
n=n+1
s=n+1
n<=2097
s<=2097
i.insert(n,str(s))
while s!=1:
	n=n+1
	s=n+1
	i.insert(n,str(s))
	if n>2097:
		break
		
y = raw_input('year:')
s = raw_input("month:")
while y not in i :
	print" year input error"
	y = raw_input('year:')
	s = raw_input("month:")
	
		
cal = calendar.month(int(y),int(s))
print cal
