n=0 for m in range(1,13): d='30' if m in(2,4,6,9,11) else '31' for i in range(10): t=m-i if t>=0and t<10:n+=(1 if str(t)+str(i)<=d else 0) print n